|
Prev: Competition is not ALWAYS good
Next: Hot Shop Baume & Mercier Linea - Baume & Mercier Minimum Price
From: Pascal J. Bourguignon on 5 May 2008 04:07 "zslevi(a)gmail.com" <levilista(a)gmail.com> writes: > On Apr 30, 5:33 pm, p...(a)informatimago.com (Pascal J. Bourguignon) > wrote, in Common Lisp: >> (defclass wheel () ((radius :type float :initarg :radius :accessor radius))) >> (defclass automobil () ((wheels :type (vector wheel) :initarg :wheels :accessor wheels))) >> (make-instance 'automobil :wheels (vector (make-instance 'wheel :radius 10.0))) > > Thanks for the example. > By the way I didn't find "vector" in the manual (I guess its a one > dimensional array, but I'd like to look up the usage syntax) , which > dialect are you using? I'm using the one from http://clipsrules.sourceforge.net/ It's a Common Lisp type. http://www.lispworks.com/documentation/HyperSpec/Body/a_vector.htm http://www.lispworks.com/documentation/HyperSpec/Front/ I notice that COOL defclass has not exactly the same syntax as CLOS defclass. (COOL = CLIPS Object Oriented Language CLOS = Common Lisp Object System) I fail to find much about arrays either in clipsrules.sourceforge.net documentation, so I guess you'd have to write something like: ;; clips code follow, not common lisp: ;; See http://clipsrules.sourceforge.net/documentation/v630/bpg.htm (defclass wheel (slot radius (default 0.5))) ; meters (defclass automobil (is-a vehicule) (multi-slot wheels (default (make-instance of wheel) (make-instance of wheel) (make-instance of wheel) (make-instance of wheel)) (access read-write))) -- __Pascal Bourguignon__
From: zslevi on 7 May 2008 07:48 On May 5, 10:07 am, p...(a)informatimago.com (Pascal J. Bourguignon) wrote: > "zsl...(a)gmail.com" <levili...(a)gmail.com> writes: > > On Apr 30, 5:33 pm, p...(a)informatimago.com (Pascal J. Bourguignon) > > wrote, in Common Lisp: > >> (defclass wheel () ((radius :type float :initarg :radius :accessor radius))) > >> (defclass automobil () ((wheels :type (vector wheel) :initarg :wheels :accessor wheels))) > >> (make-instance 'automobil :wheels (vector (make-instance 'wheel :radius 10.0))) > > > Thanks for the example. > > By the way I didn't find "vector" in the manual (I guess its a one > > dimensional array, but I'd like to look up the usage syntax) , which > > dialect are you using? I'm using the one fromhttp://clipsrules.sourceforge.net/ > > It's a Common Lisp type.http://www.lispworks.com/documentation/HyperSpec/Body/a_vector.htm > > http://www.lispworks.com/documentation/HyperSpec/Front/ > > I notice that COOL defclass has not exactly the same syntax as CLOS defclass. > (COOL = CLIPS Object Oriented Language > CLOS = Common Lisp Object System) > > I fail to find much about arrays either in clipsrules.sourceforge.net > documentation, so I guess you'd have to write something like: > > ;; clips code follow, not common lisp: > ;; Seehttp://clipsrules.sourceforge.net/documentation/v630/bpg.htm > > (defclass wheel > (slot radius (default 0.5))) ; meters > > (defclass automobil > (is-a vehicule) > (multi-slot wheels (default (make-instance of wheel) > (make-instance of wheel) > (make-instance of wheel) > (make-instance of wheel)) > (access read-write))) > > -- > __Pascal Bourguignon__ Thank you.
|
Pages: 1 Prev: Competition is not ALWAYS good Next: Hot Shop Baume & Mercier Linea - Baume & Mercier Minimum Price |