syntax - Scheme several actions if an if-statement proves true -
the way understand scheme if-statement first condition when if-statement true, , second statement when false. if want several conditions when statement proves true?
an example:
(if (= b) (set! ([a 2])) // shall happen when true (set! ([b 4])) // shall happen when true (set! ([a b])) // shall happen when not true
is possible that?
you can try use begin in if statement. so:
(if (something) (begin (foo) (bar)))
Comments
Post a Comment