this post was submitted on 21 Nov 2023
1 points (100.0% liked)
Lisp
68 readers
3 users here now
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Because
evalis what defines what the syntax of the language is, whileapplyhas nothing to do with syntax at all but only semantics. Imagine a lisp which was in latin. You would need to changeevalbut notapply. Or if there are larger changes to syntax:applyremains unchanged in all these cases.In same way, with a slight variant of
apply(it must get an environment object as well as function and arguments) then you can change the scoping rules of your Lisp while making no changes at all toevalbut only toapply. Such an evaluator is here (in Racket):