vendredi 29 mai 2015

Scheme several actions if an if-statement proves true

The way I understand a scheme if-statement is that the first condition is when the if-statement is true, and the second statement is when it is false. What if I want several conditions for when the statement proves true?

An example:

(if (= a b)
    (set! ([a 2]))  // This shall happen when true
    (set! ([b 4]))  // This shall happen when true

    (set! ([a b])) // This shall happen when NOT true

Is it possible to do something like that?

Aucun commentaire:

Enregistrer un commentaire