?

Log in

No account? Create an account
Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo. - Lindsey Kuper [entries|archive|friends|userinfo]
Lindsey Kuper

[ website | composition.al ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo. [Jun. 17th, 2008|02:48 am]
Lindsey Kuper

Sid Stamm's "evil identity":

(define evil
  ((lambda (lambda)
     ((lambda lambda) lambda))
   ((lambda 'lambda 'lambda)
    (lambda (lambda)
      (lambda lambda))
    (lambda (lambda)
      lambda))))
LinkReply

Comments:
[User Picture]From: underwhelm
2008-06-17 12:10 pm (UTC)

I don't know what that does, but:

fish fish fish fish fish.
(Reply) (Thread)
[User Picture]From: lindseykuper
2008-06-17 07:01 pm (UTC)

Re: I don't know what that does, but:

I never liked that one as much as 'buffalo'.
(Reply) (Parent) (Thread)
[User Picture]From: pmb
2008-06-17 09:10 pm (UTC)
The more I find out about it, the more I think that having separate namespaces for functions and variables is a bad idea, as is allowing variable names that clash with what would be, in any other language, reserved words.
(Reply) (Thread)
[User Picture]From: oniugnip
2008-06-17 09:52 pm (UTC)
Yeah yeah. And none of that #' nonsense from common lisp. Just saying the name of the function should be enough.

But the evil snippet, that's just an instance of the latter situation, not the former, yes?
(Reply) (Parent) (Thread)
[User Picture]From: pmb
2008-06-17 10:12 pm (UTC)
the part that reads
((lambda (lambda)
     ((lambda lambda) lambda))

defines the arguments to the "evil" function and, I believe, makes a 1-argument anonymous function that calls its argument "lambda" and returns the results of applying said function to itself twice.
(Reply) (Parent) (Thread)
[User Picture]From: pmb
2008-06-17 10:17 pm (UTC)
Which, of course, is exactly what you are pointing out. Looking more closely, I don't believe there is anything taking advantage of the variable/function namespace issue. Just the "lambda: is it a variable or the reserved word?" problem.
(Reply) (Parent) (Thread)
[User Picture]From: billings
2008-06-18 03:44 am (UTC)
I agree with the former and am ambivalent/disagree with the latter, and for pretty much the same reason. At the end of the day a language is a tool; it should have moving parts where they are necessary and useful, but not so many that you can't understand what the tool is doing to the extent that is necessary.

For this reason the namespace distinction between functions and variables doesn't make sense to me, either (well, that and some exposure to scheme). For that same reason I find it unsurprising that for the people who implemented languages like lisp and forth, languages that encourage programming by building up a vocabulary for the problem space, it made sense that the general programming language should not be that different from the languages/processes it describes.
(Reply) (Parent) (Thread)
[User Picture]From: billings
2008-06-18 03:46 am (UTC)
Lisp has keywords of course but I was sort of filling the space with hot air anyway so it's not that important
(Reply) (Parent) (Thread)
[User Picture]From: agentrayevyn
2008-06-18 04:58 am (UTC)
heh... just like the sorority. that amuses me.
(Reply) (Thread)
[User Picture]From: chadversary
2008-06-18 10:13 pm (UTC)
If i were Gordon Freeman, i would hope to find many med packs hidden near that obfuscated code.
(Reply) (Thread)