

Closures + Lambda = The key to OOP in Lisp - nickb
http://lispy.wordpress.com/2007/07/18/closures-lambda-the-key-to-oop-in-lisp/

======
palish
Sheesh.. Why? I don't understand why people keep trying to take something
which is inherently non-object-oriented (Lisp) and cram an object-oriented
mentality into it. Sure, it's nifty you can make objects without using the
Common Lisp Object System, but that's generally not how you'd want to
structure an actual application, right? Lisp is so powerful you can build and
manipulate your own structures at runtime, so you don't need to make objects
which represent a concept. Those concepts are represented through utility
functions. Maybe I'm just dumb, but I don't see it.

~~~
lispy
This is an exercise that's being done just for the fun of it to explore what
(for me) were cryptic remarks from people like Graham and Norvig.

I wanted to work on something that would force me to write macros. Obviously,
to make the code for "classes" that construct object generating functions like
the one in the example will be written by... macros. So I successfully put
myself in a situation where macros were the natural answer... and saw what I
needed to do. My getting to that particular ah-ha moment was the real message
of the post. I can now begin to understand what the experts are talking about.

So I can now use closures and macros to make lisp just as crappy as other
programming languages... or I can use this knowledge to learn more about doing
things "the lispy way." Trust me when I say that the latter option is my
preference.

I'm just an amateur that's excited about these ideas... and that you _can_ do
this sort of thing. I'm not saying that you _should_.

~~~
palish
Insightful. Thanks for exploring random things.. Maybe you'll make a discovery
that no-one else has made before.

~~~
lispy
...But more than likely just reinvent something that Guy Steele wrote a paper
on in the seventies. ^_^

------
euccastro
_"when it comes to encapsulation, the very foundation is that all state must
be accessible only from inside the object's methods."_

Screw encapsulation then. Low tech data abstraction gives you most of the
benefits without the hassle. (+)

[http://mitpress.mit.edu/sicp/full-text/book/book-
Z-H-14.html...](http://mitpress.mit.edu/sicp/full-text/book/book-
Z-H-14.html#%_sec_2.1.2)

(+) Edit: was "The real point is data abstraction."

