[closer-devel] Introducing new "type" classes

Marco Antoniotti marcoxa at cs.nyu.edu
Fri Feb 15 16:54:58 UTC 2008


PS.  I know about ANSI 4.2.2 "Type Relationships".

Marco



On Feb 15, 2008, at 16:58 , Marco Antoniotti wrote:

> Hi
>
> this is a little OT wrt Closer, but this is probably the venue  
> where most of the expertise meets.
>
> In CLOS you have classes for INTEGER, REAL etc etc.  You can then  
> write methods like
>
> 	(defmethod foo ((i integer)) ...)
>
> Now, we cannot write methods like
>
> 	(defmethod foo ((i (integer 1 42))) ...)
>
> and this may be ok.
>
> However, i am playing around with things like
>
> 	(deftype positive-integer () '(integer 1 *))
>
> is there any magic I can conjure to (semi) portably having a class  
> named POSITIVE-INTEGER that actually corresponds to the type  
> definition?
>
> Cheers
>
> --
> Marco
>
>
> _______________________________________________
> closer-devel mailing list
> closer-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/closer-devel

--
Marco Antoniotti





More information about the closer-devel mailing list