https://web.archive.org/web/20110509070204/http://wiki.ecmascript.org:80/doku.php?id=strawman:records https://web.archive.org/web/20110509070209/http://wiki.ecmascript.org:80/doku.php?id=strawman:tuples
On 17 July 2017 at 10:51, Keith Cirkel <[email protected]> wrote: > As functional programming because more mainstream - developers are leaning > more and more on immutability - with tools like immutable.js. However there > exists perfectly good solutions inside of JS with Object.seal & > Object.freeze. > > I propose making a short syntax to allow for creating of sealed/frozen > objects that looks like this: > > ```js > {| foo: 1 |} // same as Object.seal({ foo: 1 }) > {# foo: 1 #} // same as Object.freeze({ foo: 1 }) > > [| 1, 2, 3 |] // same as Object.seal([ 1, 2, 3 ]) > [# 1, 2, 3 #] // same as Object.freeze([ 1, 2, 3 ]) > > // Deep frozen objects becomes a case of using frozen notation all the way > down: > {# foo: {# bar: 1 #} #} // same as Object.freeze({ foo: Object.freeze({ > bar: 1 }) }) > [# [# 1, 2 #], [# 3, 4 #] #] // same as Object.freeze([Object.freeze([1,2]), > Object.freeze([3, 4]]) > ``` > > This short syntax allows for a much more expressive way of writing/reading > sealed & frozen objects. I look forward to a discussion about this. > > _______________________________________________ > es-discuss mailing list > [email protected] > https://mail.mozilla.org/listinfo/es-discuss > >
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

