From: Christophe Rhodes
Subject: MOP:CLASS-PROTOTYPE
Date: 
Message-ID: <sq65m2fv16.fsf@lambda.jcn.srcf.net>
What is the expected behaviour when MOP:CLASS-PROTOTYPE is called on a
built in class?  I understand that one of its uses is to get at
:allocation :class slot values without having to explicitly construct
an instance, but this clearly doesn't apply to built in classes.  The
table in AMOP seems to imply that CLASS-PROTOTYPE is expected to work
on built in classes, however.

The problem I currently have with it is that it would seem to be most
useful if it returned a direct instance of a class; though this isn't
spelt out in AMOP, I think it's implied.  However, for built in
classes, no such direct instances need exist; for instance, in an
implementation where INTEGER, BIGNUM and FIXNUM are all classes, there
are no direct instances of INTEGER.

Is there established practice in this area?  Would people prefer an
error or a non-direct instance in this kind of situation?

Christophe
-- 
http://www-jcsu.jesus.cam.ac.uk/~csr21/       +44 1223 510 299/+44 7729 383 757
(set-pprint-dispatch 'number (lambda (s o) (declare (special b)) (format s b)))
(defvar b "~&Just another Lisp hacker~%")    (pprint #36rJesusCollegeCambridge)

From: Rob Warnock
Subject: Re: MOP:CLASS-PROTOTYPE
Date: 
Message-ID: <soydnTbjysRsNoqiXTWc-w@speakeasy.net>
Christophe Rhodes  <·····@cam.ac.uk> wrote:
+---------------
| What is the expected behaviour when MOP:CLASS-PROTOTYPE is called on a
| built in class?  ...  it would seem to be most
| useful if it returned a direct instance of a class; though this isn't
| spelt out in AMOP, I think it's implied.  However, for built in
| classes, no such direct instances need exist; for instance, in an
| implementation where INTEGER, BIGNUM and FIXNUM are all classes, there
| are no direct instances of INTEGER.
| 
| Is there established practice in this area?
+---------------

Well, FWIW, CMUCL offers up some amusing ad-hoc values:    ;-}  ;-}

	cmu> (mapcar (lambda (x) (pcl:class-prototype (find-class x)))
		     '(integer bignum fixnum ratio real complex))

	(1 42 42 1/2 42 #C(1 1))
	cmu> 


-Rob

-----
Rob Warnock, PP-ASEL-IA		<····@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607
From: Barry Margolin
Subject: Re: MOP:CLASS-PROTOTYPE
Date: 
Message-ID: <OiTRa.259$0z4.250@news.level3.com>
In article <······················@speakeasy.net>,
Rob Warnock <····@rpw3.org> wrote:
>Well, FWIW, CMUCL offers up some amusing ad-hoc values:    ;-}  ;-}
>
>	cmu> (mapcar (lambda (x) (pcl:class-prototype (find-class x)))
>		     '(integer bignum fixnum ratio real complex))
>
>	(1 42 42 1/2 42 #C(1 1))

42 is a bignum?  Was it was designed by primitives, who considered any
number above 3 to be "many".

-- 
Barry Margolin, ··············@level3.com
Level(3), Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
From: sv0f
Subject: Re: MOP:CLASS-PROTOTYPE
Date: 
Message-ID: <none-2E9A91.14400022072003@news.vanderbilt.edu>
In article <·················@news.level3.com>,
 Barry Margolin <··············@level3.com> wrote:

>In article <······················@speakeasy.net>,
>Rob Warnock <····@rpw3.org> wrote:
>>Well, FWIW, CMUCL offers up some amusing ad-hoc values:    ;-}  ;-}
[...]
>
>42 is a bignum?  Was it was designed by primitives, who considered any
>number above 3 to be "many".


Well, it is the Answer for Life, The Universe and Everything.
That's gotta be a bignum, right?

(See Douglas Adams)