Mysterious Racket error: define: unbound identifier; also, no #%app syntax transformer is bound in: define

前端 未结 2 1122
旧时难觅i
旧时难觅i 2021-01-02 13:12

This program produces an error:

define: unbound identifier;
 also, no #%app syntax transformer is bound in: define

When pasted into the RE

2条回答
  •  无人及你
    2021-01-02 14:04

    I would write the Common Lisp version slightly simpler:

    (defun eval-clause (clause state)
      (loop for (var value) in state
            do (set var value))
      (some #'eval clause))
    

    The LOOP form is more descriptive (since we can get rid of CAR and NTH) and EVAL can be directly used in the SOME function.

提交回复
热议问题