On Mar 19, 7:17 am, David Nolen <dnolen.li...@gmail.com> wrote:
> Doesn't On Lisp talk about simulating CLOS with closures? It's free online.

Building either class-based or prototype-based object systems on
closures is pretty straightforward. A closure carries abritrary state
around in the closed-over lexical environment. Make the closure
function a suitable dispatching function, and you can then use it as a
building block to build any sort of object system you like. Probably
you then want to write some macros to provide a graceful syntax for
interacting with whatever object system it is you've invented.


> I would like to add as the creator that I would not use Spinoza yet ;) And
> I've put it on hold as I'm currently obsessed with trying to port cl-cont.
>  Spinoza still needs quite a bit of work, I started on that before a few
> things changed in Clojure.  I will get back to it.  Having now played with
> Clojure for a bit I'm not sure how useful Spinoza will turn out to be for
> anything beyond supporting widgets in a web framework.  With Clojure's
> flexibility it's really tough to come up with reasons to resort to an object
> system.
> That said, it at least shows that building a more traditional class system
> is not very difficult in Clojure.

And, as you suggest, probably not needed. After experimenting with
data structures in my application, I'm satisfied with maps and
sequences, though I have added a few utilities for making expected and
required fields and arguments more explicit in my source.

The part of CLOS that I actually want is generic functions. I also
experimented with making my own gf implementation, then switched my
app back and forth between that and Clojure's multifns a few times to
see whether I really prefer gfs. Turns out I do, so I'm plowing some
more work into the gf implementation.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to