Re: How to display some text in Pilog

2016-11-23 Thread Alexander Burger
Hi Eric, > stuck on some basic things. For example, how would you translate this Prolog > term: > > intro :- > > write("somme text ..."). We need to call Lisp here : (be prin (@X) (^ @ (prin (-> @X))) ) -> prin : (? (prin "Hello world\n")) Hello world -> T : (be i

Re: How to display some text in Pilog - SOLVED

2016-11-23 Thread CILz
Hello Alex, Thank you very much, that's it. In fact, I have tried this solution before asking on the list, however as I am still not very fluent in Lisp I have written : : (be intro (prin "Hello world\n") ) without the two >> () << at the beginning of the defintion of the predicate!!

typo in tutorial re 'till' ?

2016-11-23 Thread dean
Not a big deal but... it seems there is one too many ')' on the end resulting in bad input rather than "fact" : (in "@doc/fun.l" (from "(de ") (till " " T))) -> "fact"

Re: typo in tutorial re 'till' ?

2016-11-23 Thread Alexander Burger
On Wed, Nov 23, 2016 at 09:52:32AM +, dean wrote: > resulting in bad input rather than "fact" > : (in "@doc/fun.l" (from "(de ") (till " " T))) Thanks Dean! Fixed in next release. ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

read in Pilog

2016-11-23 Thread CILz
Is there a way to have something similar to 'read' in Pilog? Thanks, Eric -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Re: typo in tutorial re 'till' ?

2016-11-23 Thread dean
Hi Alex You're very welcome, On 23 November 2016 at 10:53, Alexander Burger wrote: > On Wed, Nov 23, 2016 at 09:52:32AM +, dean wrote: > > resulting in bad input rather than "fact" > > : (in "@doc/fun.l" (from "(de ") (till " " T))) > > Thanks Dean! Fixed in next release. > > ♪♫ Alex > -- >

Re: read in Pilog

2016-11-23 Thread Alexander Burger
Hi Eric, > Is there a way to have something similar to 'read' in Pilog? Here too some Lisp function must be called. However, it depends what you mean with "read": You can call the 'read' function which reads s-expressions in Lisp syntax (or lists of tokens when called with an additional argument

Re: read in Pilog

2016-11-23 Thread CILz
Alex, thanks for being so patient! I came up with this: (be p_read () (^ @ (read)) ) which looks to work so far ;-). However I wonder if there is a way to catch and unify the read value to a variable. For example in Prolog the predicate 'read/1' allows to catch in 'read(Value)' where 'Val

Re: read in Pilog

2016-11-23 Thread Alexander Burger
On Wed, Nov 23, 2016 at 07:19:05PM +0100, CILz wrote: > Alex, thanks for being so patient! I came up with this: > > (be p_read () > (^ @ (read)) ) > > which looks to work so far ;-). > > However I wonder if there is a way to catch and unify the read value to a > variable. : (be read (@X)

iterate over list until you find a match

2016-11-23 Thread dean
I'm just wondering what my options are re doing this (de mmbr (Trgt L) (for Ele L (if (== Ele Trgt) (println "found so exit with true") (println "try next") ) ) (prinl "list exhausted so return false") ) (mmbr 'B '(A B C)) I only know how to itera

Re: read in Pilog - SOLVED

2016-11-23 Thread CILz
Alex, you rock! Thanks very much. Eric Le 23/11/2016 à 20:23, Alexander Burger a écrit : : (be read (@X) (^ @X (read)) ) -> read : (? (read @A)) (foo bar) @A=(foo bar) -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Re: iterate over list until you find a match

2016-11-23 Thread Alexander Burger
Hi Dean, > I'm just wondering what my options are re doing this > > (de mmbr (Trgt L) >(for Ele L > (if (== Ele Trgt) (println "found so exit with true") > (println "try next") > ) >) >(prinl "list exhausted so return false") > ) > > (mmbr 'B '

Re: iterate over list until you find a match

2016-11-23 Thread dean
Alex Thank you very much for this. Best Regards Dean On 23 November 2016 at 21:00, Alexander Burger wrote: > Hi Dean, > > > I'm just wondering what my options are re doing this > > > > (de mmbr (Trgt L) > >(for Ele L > > (if (== Ele Trgt) (println "found so exit with true") > >