How to make if run one time each?
Posted: Sun Dec 29, 2013 1:12 pm
just say
and this output as :
Is it different to C ?
Cause I thought (if ) only run once, so the output should be one line , a 0
new lisp can not do it ?
Code: Select all
(setq test 0)
(if (= test 0) (begin (println test) (++ test)) (= test 1) (begin (println test)))
Code: Select all
> (if (= test 0) (begin (println test) (++ test)) (= test 1) (begin (println test)))
0
1
Cause I thought (if ) only run once, so the output should be one line , a 0
new lisp can not do it ?