Prev: Slime with Squeeze?
Next: Anybody mind to translate this Felleisen quote from German to English
From: joswig on 24 Feb 2010 13:55 On 24 Feb., 19:47, piscesboy <oraclmas...(a)gmail.com> wrote: > On Feb 24, 1:24 pm, Tamas K Papp <tkp...(a)gmail.com> wrote: > > > On Wed, 24 Feb 2010 06:50:48 -0800, piscesboy wrote: > > > number of slots available to a class is supposed to be implementation > > > dependent > > > This is probably my ignorance, but where does it say this in the HS? > > > Thanks, > > > Tamas > > Hmmmm...I wondered about that too, so I read it again, here: > > http://cl-cookbook.sourceforge.net/clos-tutorial/index.html > > Section 3. Classes and Instances: > > "Structures can have any number of slots, from zero up (to some > implementation-defined limit, e.g. 254 in LispWorks for Windows) and - > as with lists and general vectors - the slots can hold any values." > > but I don't know whether it applies to classes in CLOS per se, even > though they are technically structures. > > But anyway, this may be a superfluous detail that doesn't help me > solve a problem as to why a class I created cannot even handle 8 slots > let alone 254. How about posting your code, so that we can see what it wrong?
From: Ron Garret on 24 Feb 2010 14:30 In article <f26609e2-e61d-483b-8aab-375e754eedef(a)b2g2000yqi.googlegroups.com>, piscesboy <oraclmaster(a)gmail.com> wrote: > On Feb 24, 11:38 am, p...(a)informatimago.com (Pascal J. Bourguignon) > wrote: > > piscesboy <oraclmas...(a)gmail.com> writes: > > > Strangely, when I created a class instance in CLOS containing more > > > than 8 slots, any slot values entered after the 8th are ignored. The > > > number of slots available to a class is supposed to be implementation > > > dependent, so how do I find out/change what it is for clisp on Mac OS > > > X? > > > > I don't observe any problem: > > > > C/USER[19]> (defmacro defclass-with-a-lot-of-slots (class super > > number-of-slots) > > `(defclass ,class ,super > > ,(loop > > for i from 0 below number-of-slots > > for s = (intern (format nil "SLOT-~D" i)) > > for k = (intern (format nil "SLOT-~D" i) "KEYWORD") > > collect `(,s :accessor ,s :initarg ,k)))) > > DEFCLASS-WITH-A-LOT-OF-SLOTS > > C/USER[20]> (defclass-with-a-lot-of-slots a () 1000) > > WARNING: DEFCLASS: Class A (or one of its ancestors) is being redefined, > > instances are obsolete > > #1=#<STANDARD-CLASS A :VERSION 1> > > C/USER[21]> (defvar *a* (make-instance 'a :slot-999 999 :slot-60 60)) > > *A* > > C/USER[22]> (defparameter *a* (make-instance 'a :slot-999 999 :slot-60 60)) > > *A* > > C/USER[23]> (slot-60 *a*) > > 60 > > C/USER[24]> (slot-999 *a*) > > 999 > > C/USER[25]> > > > > -- > > __Pascal Bourguignon__ > > I used the 'make-instance macro. Is that the issue? I think the issue is that you're being dense. There is no such thing as "the MAKE-INSTANCE macro." MAKE-INSTANCE is a generic function. Whatever problem you are having, it isn't what you think. Post a transcript. rg
From: Captain Obvious on 24 Feb 2010 14:00 p> Strangely, when I created a class instance in CLOS containing more p> than 8 slots, any slot values entered after the 8th are ignored. The p> number of slots available to a class is supposed to be implementation p> dependent, so how do I find out/change what it is for clisp on Mac OS p> X? 8 slots per class would be just ridiculous limitation. So, either you have a bug in your code or CL implementation you're using is broken.
From: Tim Bradshaw on 24 Feb 2010 17:35 On 2010-02-24 18:24:01 +0000, Tamas K Papp said: > This is probably my ignorance, but where does it say this in the HS? I can't find a limit specified (or even that there might be a limit) either for instances of STANDARD-CLASS or STRUCTURE-CLASS. I may not be looking carefully enough though, and it is probably implicitly no more than ARRAY-TOTAL-SIZE-LIMIT. It's clear the OP has some confusion I think.
First
|
Prev
|
Pages: 1 2 Prev: Slime with Squeeze? Next: Anybody mind to translate this Felleisen quote from German to English |