Deterministic Proposal

Bradley Meck bradley.meck at gmail.com
Wed Jun 21 16:40:58 UTC 2017


>
> You probably mean "pure", not "deterministic", which has nothing to do
> with this. However, JavaScript is far, far too impure for any such
> annotation to ever make sense or enable any sort of memoization. Consider
> let i = 0
> let o = {valueOf() {return i++}}
> sum(o, 0)
> sum(o, 0)


If type coercion was disabled within "pure" functions I am not sure this
would be a problem.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20170621/aebfe669/attachment-0001.html>


More information about the es-discuss mailing list