functional programming - No operation in Scheme Language -
i having trouble in how define no operation in scheme language
like ; in c
i want this:
(cond [(null? exp) nop ] ..... )
if leave empty wiil return #t thanks!
scheme has no statements, expressions. each expression returns value -or may never return-
so want expression not compute much. use nil (or #f
, or other value) purpose:
(cond ((null? exp) ()) .... )
if wrote condition test - , no "then" body sub-expressions
(cond ((null? exp)) )
then result of cond
when exp
nil result of (null? exp)
test #t
actually, when exp
null, return exp
itself.
Comments
Post a Comment