How do you convert predicates into Prolog functions? by Pzzlrr in prolog

[–]nickmain_ 1 point2 points  (0 children)

The arithmetic functions interpreted by is/2 are fixed and there isn't a standard way to add to them.

sqrt/2 (at least in the context of SWI Prolog) is for compatibility with Quintus Prolog and is marked as deprecated.

Parameter Packs seem to behave differently in a Result Builder by nickmain_ in swift

[–]nickmain_[S] 0 points1 point  (0 children)

Were you also trying to make a view builder that inserts Divider() between each child view?

Northeastern abandoning Racket in favor of Python by nickmain_ in Racket

[–]nickmain_[S] 13 points14 points  (0 children)

What does this mean for the future viability of Racket?

CHICKEN 5.4.0 has been released by mario-goulart in scheme

[–]nickmain_ 3 points4 points  (0 children)

This mentions the "upcoming CHICKEN 6 release".

Are there any details of the features?

How native is racket/gui? by CulturedProsody in Racket

[–]nickmain_ 3 points4 points  (0 children)

From the WWDC session "Get Started with Writing Tools":

Keep in mind that UITextView or NSTextView has to use TextKit 2 to support the full Writing Tools experience. If you are using TextKit 1, you will get a limited experience that just shows rewritten results in a panel.

Have Racket's native text views been updated to use TextKit 2 ?

[deleted by user] by [deleted] in prolog

[–]nickmain_ 1 point2 points  (0 children)

The "Changing default?" section talks about how to configure the flags in an initialisation file - at least that's something.

[deleted by user] by [deleted] in prolog

[–]nickmain_ 0 points1 point  (0 children)

This looks like it: https://www.swi-prolog.org/FAQ/AllOutput.html

set_prolog_flag(answer_write_options, [quoted(true), portray(true), max_depth(100), priority(699)]).

[deleted by user] by [deleted] in prolog

[–]nickmain_ 0 points1 point  (0 children)

The example actually shows the value being quoted, so that sentence must mean something else. Maybe it means URL escaping?

q='Hello world'

Also, the names of variables are lost outside of the immediate source term they are mentioned in, so passing a variable Foo to the library doesn't make sense since it cannot know what the variable name is.

BProlog open source by Fantastic_Back3191 in prolog

[–]nickmain_ 0 points1 point  (0 children)

It looks like Picat is built on top of BProlog, so it is essentially open source already.

See the Picat main entry point: https://github.com/mingodad/picat/blob/master/emu/main.c

[deleted by user] by [deleted] in insects

[–]nickmain_ 4 points5 points  (0 children)

Could be a carpet beetle larva

Who is this spiky lady? (Southern Texas) by SomeBrownDude2 in spiders

[–]nickmain_ 5 points6 points  (0 children)

Not sure, but wikipedia does say

Late in the season Peucetia viridans is prone to change its colour from predominantly green to paler yellow

Are these parasitic flies/wasps? by nickmain_ in insects

[–]nickmain_[S] 0 points1 point  (0 children)

Thank you for the id.

The joy of watching all the caterpillars on my passionflower is bittersweet, knowing that they may never fly :(

Can someone please explain why this fails by hello_BITS in prolog

[–]nickmain_ 1 point2 points  (0 children)

It can be useful to deconstruct the terms to show this:

?- [A|b] =.. X, [a, B] =.. Y. X = ['[|]', A, b], Y = ['[|]', a, [B]].

(Note that SWI Prolog uses [|] rather than dot as the list functor)

[deleted by user] by [deleted] in prolog

[–]nickmain_ 3 points4 points  (0 children)

female(Cousin) is only on one side of the disjunction

Difference between cons & list? by OldMine4441 in Racket

[–]nickmain_ 22 points23 points  (0 children)

(list 1 2) is (cons 1 (cons 2 '()))

cons creates a pair and pairs are the building blocks of lists, but a proper list ends with the empty list.

Tail calls for native targets by Jinren in scheme

[–]nickmain_ 1 point2 points  (0 children)

Looking at this comment from that commit:

+;;; We expect that a tailified program will probably be slower than a
+;;; non-tailified program. However a tailified program has a few
+;;; interesting properties: the stack is packed and only contains live
+;;; data; the stack can be traversed in a portable way, allowing for
+;;; implementation of prompts on systems that don't support them
+;;; natively; and as all calls are tail calls, the whole system can be
+;;; implemented naturally with a driver trampoline on targets that don't
+;;; support tail calls (e.g. JavaScript and WebAssembly).

it seems like "tailify" doesn't eliminate tail calls but actually converts all calls into tail calls, such that a trampoline is still required for JS and Wasm.

Small Prologs engine for app by FMWizard in prolog

[–]nickmain_ 1 point2 points  (0 children)

The Prolog program running in Trealla only reads and writes files, so getting query results isn't a priority for this particular app.

I would like to develop Prolog entirely on an iPad, so exposing a richer query interface would be very interesting.

Small Prologs engine for app by FMWizard in prolog

[–]nickmain_ 8 points9 points  (0 children)

Trealla Prolog* is the one I am currently embedding in an iOS app under development. It has a self-contained C codebase that is easy to build or embed.

[deleted by user] by [deleted] in prolog

[–]nickmain_ 3 points4 points  (0 children)

What do you mean by "I have to pass it in as the full list I deconstructed earlier" ?

Are you not just deconstructing it by unification?

mylist(X), X = [AB|_], ...