scheme-macros icon indicating copy to clipboard operation
scheme-macros copied to clipboard

loop is a bad example of non-hygiene

Open johnwcowan opened this issue 2 years ago • 0 comments

The trouble with creating identifiers out of nothing is that the result doesn't compose with itself. break will break out of a loop, but given a nested loop it is only possible to break out of the inner loop, not the outer one. (The same problem arises with "anaphoric if", the version of if that binds the variable it to the value of the boolean expression.) I think such examples should be avoided. The define/who is a safe but trivial use (that could be accomplished using syntax parameters, I think). Another reasonable use is the CL-style variant of define-record-type in which the names of the constructor, predicate, accessors, and mutators are manufactured for you; a simplified example might be pedagogically useful.

johnwcowan avatar Nov 23 '23 16:11 johnwcowan