Ah, I see. There is freedom on the part of implementations here.
On Tue, Oct 9, 2012 at 2:34 PM, archisman rudra <archi.rudra@gmail.com> wrote:
Is this correct behavior?CL-USER(17): (type-of 1234567898723618080928927362387)(INTEGER 2147483648)
The relevant java code is in Bignum.java: (the value field is a java BigInteger)@Overridepublic LispObject typeOf(){if (value.signum() > 0)return list(Symbol.INTEGER,new Bignum((long)Integer.MAX_VALUE + 1));return Symbol.BIGNUM;}for comparison:CL-USER(23): (type-of -1234567898723618080928927362387)BIGNUMwhich makes intuitive sense.Relevant bits of type-of description:
Returns a type specifier, typespec, for a type that has the object as an element. The typespec satisfies the following:
- 1. For any object that is an element of some built-in type:
- a. the type returned is a recognizable subtype of that built-in type.
- b. the type returned does not involve and, eql, member, not, or, satisfies, or values.
- 3. The type returned by type-of is always a recognizable subtype of the class returned by class-of. That is,
(subtypep (type-of object) (class-of object)) => true, trueSo my read is that there's no guarantee of literal repeatability between the returned values of type-of even in subsequent calls, never mind between implementations.-Alan
_______________________________________________
armedbear-devel mailing list
armedbear-devel@common-lisp.net
http://lists.common-lisp.net/cgi-bin/mailman/listinfo/armedbear-devel