I suppose there is no progn

Started by shercipher, May 13, 2009, 09:18:58 PM

Previous topic - Next topic

shercipher

For expressions that need to be evaluated sequentially in newLisp, there is no progn special form that says "evaluate these and return the last".



So how do I make code like this valid?



(if (expr)
 ((eval 1) (eval 2) (eval3))
 (eval4))


It seems to execute the forms correctly, except that at the end of executing the forms it says "ERR: value expected: (whatever the last form was)"

HPW

#1
Use 'begin' instead.



Or somewhere:

(setq progn begin)
(constant(global 'progn))


Then you have 'progn'
Hans-Peter

Lutz

#2
In the manual:



http://www.newlisp.org/newlisp_manual.html#begin">http://www.newlisp.org/newlisp_manual.html#begin



In the Code Patterns document in the "Blocks" section:



http://www.newlisp.org/CodePatterns.html#flow">http://www.newlisp.org/CodePatterns.html#flow