newLISP Fan Club

Forum => newLISP in the real world => Topic started by: shercipher on May 13, 2009, 09:18:58 PM

Title: I suppose there is no progn
Post by: shercipher on May 13, 2009, 09:18:58 PM
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)"
Title:
Post by: HPW on May 13, 2009, 10:29:28 PM
Use 'begin' instead.



Or somewhere:

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


Then you have 'progn'
Title:
Post by: Lutz on May 14, 2009, 05:03:44 AM
In the manual:



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



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



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