On Oct 5, 2009, at 5:45 PM, ANA TANASESCU wrote:


(while (?result next)
(bind ?list (create$ (?result getSymbol e1)(?result getSymbol e2))))

(printout t "List is " ?list  crlf)


Each time through this loop, you create a new list containing a single element and bind it to ?list; at the end of the loop, of course ?list contains just the single list you created on the last iteration. This is really no different from what would happen if you wrote similar code in Java. If you want to add to the list, then each call to create $ should include the previous value of the list as part of the new list; i.e.


(bind ?list (create$ e1))
(while (?result next)
    (bind ?list (create$ ?list (?result getSymbol e2)))

After this loop, ?list will be (e1 a b c d) .

---------------------------------------------------------
Ernest Friedman-Hill
Informatics & Decision Sciences, Sandia National Laboratories
PO Box 969, MS 9012, Livermore, CA 94550
http://www.jessrules.com







--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [email protected]'
in the BODY of a message to [email protected], NOT to the list
(use your own address!) List problems? Notify [email protected].
--------------------------------------------------------------------

Reply via email to