[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

wimpy COERCE function



    Date: Sunday, 28 April 1985, 19:25-EDT
    From: Niels Lauritzen <SR.LAURITZEN at MIT-SPEECH>

    In Symbolics 3670 Release 6.0

    >>Error: I don't know how to coerce an object to an integer modulo 3

    Hey, any computer ought to know how to coerce integers to integers modulo N.

    COERCE:  (P.C. = 22)
       Arg 0 (OBJECT): 45
       Arg 1 (TO-TYPE): (MOD 3)

I agree that this coercion would be easy to implement, provided you could get everyone
to agree that what you meant was (MOD 45 3) rather than signalling an error that 45
was out of range.

On the other hand, if you read the documentation of COERCE in the Common Lisp manual,
this is not one of the coercions that it lists as permissible.

I'm cc'ing this to the Common-Lisp mailing list in case anyone there wants to discuss
the pros and cons of what Common Lisp specifies for COERCE.  That discussion should
not include the other recipients, please.