From: Haris Bogdanovic Date: 2009-01-09T21:19:38+09:00 Subject: Re: functional programming I meant, every expression is an object. Not sure that's the case with clisp. "Pascal J. Bourguignon" wrote in message news:87hc48bsgp.fsf@informatimago.com... > "Haris Bogdanovic" writes: > >> In Ruby everything is an object. That's my favourite Ruby's feature. And >> you >> showed that by just making one module you can have Lisp like functional >> programming. So I'll stick with Ruby. > > In Lisp too, everything is an object. But there are several kinds of > objects, and you can create your own kinds too (you can write new > meta-classes in CLOS). > > C/USER[15]> (defclass automobile () ()) > #1=# > C/USER[16]> (defvar *car* (make-instance 'automobile)) > *CAR* > C/USER[17]> (class-of *car*) > #1=# > C/USER[18]> (class-of 1) > #1=# > C/USER[19]> (class-of "string") > #1=# > C/USER[20]> (defstruct wheel) > WHEEL > C/USER[21]> (defclass automobile () ((wheels :accessor wheels :initform > (list (make-wheel) (make-wheel) (make-wheel) (make-wheel))))) > WARNING: DEFCLASS: Class AUTOMOBILE (or one of its ancestors) is being > redefined, instances are obsolete > #1=# > C/USER[22]> (wheels *car*) > (#S(WHEEL) #S(WHEEL) #S(WHEEL) #S(WHEEL)) > C/USER[23]> (class-of (wheels *car*)) > #1=# > C/USER[24]> (class-of (first (wheels *car*))) > #1=# > C/USER[25]> > > -- > __Pascal Bourguignon__