<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,<div><br></div><div>You probably already know this, but just to make sure: The CLOS MOP specification doesn't allow any metaobjects that are instances of the predefined metaobject classes to change their classes (except for instances of forward-referenced-class).  So in that regard, type declarations that refer to CLOS classes in Common Lisp are still safe.</div><div><br></div><div>Note, however, that Common Lisp already allows for changing the (proper) names of classes. So in that regard, you don't even need the CLOS MOP to render type declarations for CLOS classes unsafe. ;)</div><div><br></div><div>Common Lisp in general has a more traditional performance model, in that it relies on staticish compilation for performance, rather than dynamic compilation as is done in Java, JavaScript, Lua, etc. With dynamic compilation, such issues may be easier to tackle, although I suspect that this would require still some non-trivial amount of research. (Changing the metaclass of a class needs to update not only the class, but also its instances, and since you potentially have an unlimited depth in the hierarchy of metaclasses, this can be quite complicated to express in a sane way.)</div><div><br></div><div>So my guess is that this is why the restriction in the CLOS MOP was put there in the first place, to have some amount of sanity in this regard.</div><div><br></div><div>Just my 0.02€…</div><div><br></div><div>Pascal</div><div><br><div><div>On 9 Oct 2012, at 22:44, Juan Jose Garcia-Ripoll <<a href="mailto:juanjose.garciaripoll@gmail.com">juanjose.garciaripoll@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Dear all,<br><div class="gmail_quote"><div><br></div><div>I am retaking an old question, which is the utility of type declarations in a language that has the flexibility of the MOP.</div><div><br></div><div>In an extremely open-minded setup, where any class is prone to change, not only their structure, but also their metaclass, it would seem that a local declaration of the kind (DECLARE (MY-CLASS FOO)) would be totally useless.</div>


<div><br></div><div>But... do you actually face that flexibility in real life? I mean, declarations such as (DECLARE (TYPE MY-INTEGER-TYPE FOO)) are used in actual code, where there is an implicit contract that the DEFTYPE type will not be changed in unsafe code. Can't we assume something similar when facing CLOS? What would be a reasonable optimization/safety/debug level to start considering that?</div>


<div><br></div><div>Best,</div><div><br></div><div>Juanjo</div><div><br></div></div>-- <br>Instituto de Física Fundamental, CSIC<br>c/ Serrano, 113b, Madrid 28006 (Spain) <br><a href="http://juanjose.garciaripoll.googlepages.com/" target="_blank">http://juanjose.garciaripoll.googlepages.com</a><br>


_______________________________________________<br>pro mailing list<br><a href="mailto:pro@common-lisp.net">pro@common-lisp.net</a><br>http://lists.common-lisp.net/cgi-bin/mailman/listinfo/pro</blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div>--</div><div>Pascal Costanza</div><div>The views expressed in this email are my own, and not those of my employer.</div><div><br></div></span><br class="Apple-interchange-newline">

</div>


<br></div></body></html>