Schemes and if condition

I want to return nothing if the condition is not met, like

(if x y z)

      

so if x fails, z will execute and I don't want to do anything at z, just like pythons "pass"

+2


source to share


1 answer


From R5RS :

Syntax

: (if test consequent alternate)

Syntax

: (if test consequent)

Semantics: The expression if

is evaluated as follows: First, the test is evaluated. If it gives a true value (see section 6.3.1), then it is evaluated and its value (s) is returned. Otherwise it is evaluated and its value (s) is returned. If the test evaluates to false and no alternative is specified, then the expression evaluates to undefined.



So your expression if

will look like this:

(if x y)

      

+10


source







All Articles