I've done this too:

Started by cormullion, August 11, 2007, 03:47:29 AM

Previous topic - Next topic

cormullion

... forgetting to group expressions in a block after if, I mean. As described by teslafreak:



http://teslafreak.vox.com/library/post/debugging-newlisp.html">//http://teslafreak.vox.com/library/post/debugging-newlisp.html



I once wrote a macro that didn't need to 'begin', but couldn't do anything 'else':


(define-macro (if* condition)
(let (c (eval condition))
   (if c (map eval (args)))))

(if* true
   (println "yes")
   (println "I've")
   (println "done")
   (println "that")
   (println "too!"))


but more recently I've started using cond a bit more.

Fanda

#1
Yes, it gets confusing in the beginning. I wrote 'if-else' to try a different solution:



http://newlisp-on-noodles.org/wiki/index.php/Flow_control#if-else">http://newlisp-on-noodles.org/wiki/inde ... ol#if-else">http://newlisp-on-noodles.org/wiki/index.php/Flow_control#if-else



Fanda