(define (add n) (lambda (m) (+ nm))) (define add4 (add 4)) (map (add 7) (list 1 2 3))
But this is just one small random example. If you dig far enough, you will find several tons of additional reasons. For a more detailed discussion, you should really go through some kind of tutorial. My recommendation for this would be PLAI .
Here's another demo:
(define tax 0.17) (define (add-tax amt) (+ amt (* amt tax)))
add-tax seems to be a function that returns a given amount with the correct tax rate, but you can never rely on it. For example, it could be called like this:
(let ((tax -0.17)) (add-tax 100))
and you will get completely wrong answers. But itβs even worse if your language is really dynamically limited: you cannot rely on any bindings, including functions. Consider this:
(let ((+ -)) (add-tax 100))
Both BTW Elisp and CL do not suffer from this problem so directly, using such things as a double namespace and shadow copy rules of "built-in" bindings.
Eli barzilay
source share