On Sun, Nov 21, 2010 at 7:05 PM, Brendan Eich <[email protected]> wrote:

> On Nov 18, 2010, at 4:08 PM, Waldemar Horwat wrote:
> [...]
> Worse, the use of colon in this new for syntax is confusingly similar to
> long-standing future-proofing intentions around runtime type annotations
> (aka guards or contracts).
>
> (BTW, I don't think :: is a good type annotation or guard punctuator, btw
> -- it's the C++ namespace qualification operator, also specified for
> namespacing by ECMA-357 (E4X) and used that way in ActionScript 3 (and in
> ES4, RIP). So I was surprised to see :: used for annotation-like syntax in
> http://wiki.ecmascript.org/doku.php?id=strawman:guards and
> http://wiki.ecmascript.org/doku.php?id=strawman:trademarks.)
>

Note that I do not consider the trademarks strawman ready for discussion.
Accordingly I had recently moved it from the strawman page to the deferred
page. I want to do a rather extensive rewrite before I'll be happy enough
with it.

I think the guards strawman is in fine shape for discussion. It postpones
most of the semantic issues to other specs (like trademarks eventually) that
would parameterize the guards strawman by proposing a concrete meaning for
its internal Coerce___ function.

The reason I chose "::" over ":" is not for a love of "::". Alternative
suggestions appreciated! However, I avoided ":" so that we could guard
properties within object literals <
http://wiki.ecmascript.org/doku.php?id=strawman:guards#guarding_properties>.
I don't see a way to use ":" for that without confusion. The ES4 solution --
that one can only annotate an object literal as a whole but not its
individual properties -- always seemed unpleasant.

-- 
    Cheers,
    --MarkM
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to