Hi pd,

> I'm using picolisp version 18.12.27 C in a debian 10.10 based distro,
> ...
> I'm playing with pilog and there're some examples that does not run:
> ...
>    (^ @I (inc @C)) )
> ...
> I can make it work if I use the -> functon this way:
> ...
>    (^ @I (inc (-> @C))) )
> 
> Is the reference documentation incorrect?

No, but it seems that you looked at the reference for pil21.

The syntax for calling Lisp expressions in Pilog was made a little friendlier in
pil21, by binding variables directly, so that calling '->' is normally not
needed any more.


> 2- the example of factorial in Mia's blog  [2] :
> ...
> Again I get it working using the -> function this way:

Yes, exactly. So for pil64 and pil32 the old syntax is still required.

> I assume the use of -> function is needed but that means picolisp
> documentation and Mia's blog is wrong.

Not wrong, but it focuses exclusively on pil21.

> ...
> but I cannot get an answer for the inverse query:
> 
> : (? (factorial @X 120))
> -> NIL

This is another issue. This Pilog version of factorial cannot do reverse lookup,
as it calculate numeric values via Lisp calls.


> Also I would like to know if pilog unification deals with compound
> predicates, I mean, in prolog you can write:
> 
> p(a).
> p(R(y)).
> ? p( X )
> X=a
> X=R(y)
> 
> Querying for values of X veryfing a p predicate. How can you get that in
> pilog?

Yes, you can do that, but not in that direct syntax.

You could take a look at how 'not', 'call' or 'or' are implemented in
@lib/pilog.l for examples.

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to