Re: When slots :type are used

Didier Verna <[email protected]>
Newsgroups gmane.lisp.cmucl.general,gmane.lisp.cmucl.devel
Message-ID <[email protected]>
Madhu <[email protected]> wrote:

> * Raymond Toy <[email protected]> :
> Wrote on Wed, 10 Dec 2008 11:21:08 -0500:
>
> |>>>>> "dvl" == Didier Verna <[email protected]> writes:
>
> |     dvl> But doing so by making (setf (slot-value))'s behavior
> |     dvl> different (shall I say inconsistent?) depending on the
> |     dvl> context feels somewhat weird to
> |
> |     Raymond> Yes, I think it's inconsistent.
> |
> |     dvl> me. I guess you concern is performance here; but then, we can
> |     dvl> play with the optimize declaration.
>
> The other concern was compatibility with other lisps which do not signal
> an error when the type declaration is wrong.

  Well, SBCL at least does, with (speed 0) and (safety 3).


> This particular typecheck is not mandated by any spec, and lisps tend
> to let it pass.

  Yup. ACL doesn't perform any kind of typechecking whatsoever.


> | Perhaps not the best solution, but I have made an internal change so
> | that pcl::*use-slot-type-p* will be honored (at runtime). Hence,
> | type checking will be done accordingly.
>
> Thanks, I have no problems setting pcl::*use-slot-types-p* when
> compiling code with incorrect typespecs but thinking out aloud [on
> behalf of the devil] perhaps the default behaviour should be a warning

  Why would you prefer it to be a warning [on behalf of the angel ;-)] ?

-- 
Resistance is futile. You will be jazzimilated.

Scientific site:   http://www.lrde.epita.fr/~didier
Music (Jazz) site: http://www.didierverna.com

EPITA/LRDE, 14-16 rue Voltaire, 94276 Le Kremlin-Bicêtre, France
Tel. +33 (0)1 44 08 01 85       Fax. +33 (0)1 53 14 59 22
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.