The Roots of Lisp
paulgraham.com
paulgraham.com
Thanks for linking this article -- it's one of my favorites.
((lambda (f) (f '(b c))) '(lambda (x) (cons 'a x)))
afaics, the 2nd lambda shouldn't be quoted.
danger: possible syntax loss
There's some noise but the important part is that both x and y have the same address (0x37e300) and point to the same str object.
Python 2.6.4 (r264:75706, Nov 25 2009, 21:38:24)
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> x='foo'
>>> y='foo'
>>> x.__add__
<method-wrapper '__add__' of str object at 0x37e300>
>>> y.__add__
<method-wrapper '__add__' of str object at 0x37e300>
>>> x is y
True
and a counter-example just for fun: >>> x='this is a longer string. i wonder what the limit is?!'
>>> y='this is a longer string. i wonder what the limit is?!'
>>> x.__add__
<method-wrapper '__add__' of str object at 0x35a840>
>>> y.__add__
<method-wrapper '__add__' of str object at 0x35a890>
>>> x is y
False