Re: iterate over list until you find a match

2016-11-24 Thread dean
No you didn't misunderstand AlexI guessed the necessity for "for" when the extracted line gave an error but didn't understand why. Your referral to "for"s documentation explained though I had to play with some examples to drum it in :). Cristophe's examples were very helpful too because

Re: iterate over list until you find a match

2016-11-24 Thread Alexander Burger
Hi Christophe, > >> : (T (== 1 1) T) > >> !? (T (== 1 1) T) > >> T -- Undefined > > Hi Alex, I'm not sure that you understood Dean's question. > Or maybe I didn't understand your answer. Not sure. I hope I didn't misunderstand ;) > What Dean did: > To understand your definition of mmbr, Dean

Re: iterate over list until you find a match

2016-11-24 Thread dean
Alex, Cristophe I can see I've got quite a bit to learn. Thank you for drawing my attention to the way FOR and Lisp work. I wasn't expecting that at all but it looks very elegant. Thank you also for the extra examples. They do help. Best Regards Dean On 24 November 2016 at 15:35, Christophe

Re: iterate over list until you find a match

2016-11-24 Thread Christophe Gragnic
On Thu, Nov 24, 2016 at 1:24 PM, Alexander Burger wrote: > Hi Dean, > >> : (T (== 1 1) T) >> !? (T (== 1 1) T) >> T -- Undefined >> .. >> i.e. I'm assuming this is a... >> "A list is evaluated as a function call, with the CAR as the function >> and the CDR the arguments to

How to put my small expert system in pilog on the web

2016-11-24 Thread CILz
Hello, Thanks to your help so far, I have built a small expert system in Pilog which works interactively on the terminal. A question is displayed, the user is asked to answer by 'y' or 'n' and in turn a new question is displayed or the result of the process. Now I want this to work on in

Re: iterate over list until you find a match

2016-11-24 Thread Alexander Burger
Hi Dean, > : (T (== 1 1) T) > !? (T (== 1 1) T) > T -- Undefined > .. > i.e. I'm assuming this is a... > "A list is evaluated as a function call, with the CAR as the function > and the CDR the arguments to that function. These arguments are in turn > evaluated according to these three rules." >

Re: iterate over list until you find a match

2016-11-24 Thread dean
If I isolate the following line... I get T as undefined : (T (== 1 1) T) !? (T (== 1 1) T) T -- Undefined Whereas...inside the function (de mmbr (Trgt L) (for Ele L #(T (== Ele Trgt) T) (T (== 1 1) T) ) ) : (mmbr 'B '(A B C)) -> T : (mmbr 'D '(A B C)) -> T it works fine. I'm