typed objects and value types
Mark S. Miller
erights at google.com
Wed Apr 2 10:11:39 PDT 2014
I just got to the Appendix B at the end of your article, so I see you were
aware of the strictness issue. The semantics of a failed assignment to a
field of a value type should indeed just be the semantics of a failed
assignment: if the assignment is performed by sloppy code, the failure is
silent. If the failed assignment is performed by strict code, it throws.
On Wed, Apr 2, 2014 at 9:20 AM, Mark S. Miller <erights at google.com> wrote:
> On Wed, Apr 2, 2014 at 7:32 AM, Niko Matsakis <niko at alum.mit.edu> wrote:
>
>> I just wanted to let people on es-discuss know about two of my recent
>> blog posts concerning typed objects. The first is a kind of status
>> report:
>>
>>
>> http://smallcultfollowing.com/babysteps/blog/2014/04/01/typed-objects-status-report/
>>
>> and the second details some (preliminary) thoughts on how one could
>> build on typed objects to support user-defined value types:
>>
>>
>> http://smallcultfollowing.com/babysteps/blog/2014/04/01/value-types-in-javascript/
>
>
> Just a quick local editorial comment for now:
>
> ...
> points[0].x = 1;
> ...
> But assigning to a field of a value object like temp has no effect, and
> hence the assignment is lost.
>
>
> Please assume (and state if you feel it is needed) that all example code
> is strict code. Introducing abstractions, like value types, that cause
> assignments such as this to fail would be insane if the clients of these
> abstractions were sloppy. If the client code were sloppy, these failures
> would be silent as you state, and the code would proceed on execution paths
> that assume success. By assuming that client code is sloppy, you
> unnecessarily burden, distract, and mislead the reader, as not one in a
> thousand truly understands the semantics of sloppy mode.
>
> Substantive comments later. Quick reaction: I like it!
>
>
>>
>> Niko
>> _______________________________________________
>> es-discuss mailing list
>> es-discuss at mozilla.org
>> https://mail.mozilla.org/listinfo/es-discuss
>>
>
>
>
> --
> Cheers,
> --MarkM
>
--
Cheers,
--MarkM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140402/52317504/attachment.html>
More information about the es-discuss
mailing list