On Mon, Apr 11, 2011 at 2:48 PM, Mike Samuel <[email protected]> wrote:
> 2011/4/11 Mark S. Miller <[email protected]>: > > > We would like a notion of correctness that allows us to reason in a > modular > > manner: A correct composition of individually correct components should > > yield a correct composite, where the correctness of the composition > depends > > only on the contracts of the components to be composed -- not on their > > implementation. The Java composite above is incorrect because the key is > > incorrect. This does not contradict the notion that the hashtable > > abstraction by itself is correct even though in this case it behaves > > incorrectly. > > The problem here is specifically with the methods on Object.prototype vs > the > > pervasive use of objects as string->value maps in JavaScript. What are we > to > > do about > > getDefiningObject(JSON.parse(str), 'foo') > > ? Even without mutual suspicion within the program code, we would like to > > reason about the correctness of this as quantified over all strings, for > > example, even if the string is received from an external untrusted or > > unreliable source. > > Would you agree with the following?: > > Given that stackoverflow.com and user-commenting documentation sites ( > http://www.php.net/manual/en/ref.pcre.php ) encourage teaching by > sharing copy/pasteable snippets of source code, we would like > experienced devs to be able to compose succinct snippets that can be > shared without an accompanying page of caveats that few will read or > know how to check. > Excellent. +1 -- Cheers, --MarkM
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

