I would like to write an interpreter for if and cond statements in scheme, however I couldnt do cond part.My cond has else part always.
<cond -> ( cond <conditional_list> <else_condition> )
<conditional_list -> <conditional | <conditional <conditional_list
<conditional -> ( <expr <expr )
<else_condition -> ( else <expr )
Here is my if part :
((if-stmt? e)
(if (not (eq? (my_interpreter (cadr e) env) 0))
( my_interpreter (caddr e) env)
( my_interpreter (cadddr e) env)))
Any help is appreciated thank you!
if). Cond is better implemented as a macro. Same goes for things likelet,let*,define, etc. - SK-logic