|
![](/i/fill.gif) |
Darren New escreveu:
> Warp wrote:
>> In my little experience, trying to use a programming paradigm (eg. OOP)
>> with a language which has no specific support for that paradigm (eg.
>> traditional lisp or scheme, or C) only creates a ton of kludges.
>
> Actually, LISP has excellent support for OO. It has closures (which are
> objects without the types, not unlike javascript objects) and it has
> macros that let you Do The Right Thing with the syntax and integrate it
> cleanly into the language. It's not going to look like Java/C++/C#/etc
> classes, but I'd disagree it's a kludge.
More than that, Common Lisp has CLOS:
http://en.wikipedia.org/wiki/Common_Lisp_Object_System
> I don't remember scheme enough to know how clean it is, and I'll agree
> with you on the C part. :-) And that's not to say there aren't things
> that would be very difficult to do in LISP without native support built
> into the language (like some forms of control flow, for example).
Are you kidding? One of the main strenghts of Lisp is its macro system.
Not dumb C preprocessing, a metaprogramming features which allows you
to create nice new syntax for any control flow you want.
See:
http://www.paulgraham.com/onlisp.html
Scheme itself lives up to its original goal as a minimalist and
incredibly flexible and powerful language. See for instance an
implementation of a full-fledged, purely functional object-system:
http://okmij.org/ftp/Scheme/index.html#pure-oo
This is done purely with functions and will look awkward for Warp in the
way they are called, but thing is: one layer of macros later and it
looks just as integrated into the language as if OO was always there.
Post a reply to this message
|
![](/i/fill.gif) |