Re: Conditional assign operator

2020-04-13 Thread
See Stage 3 Logical Assignment Proposal. https://github.com/tc39/proposal-logical-assignment Thanks. 2020年4月13日 18:17 +0900、Sultan のメール: > The following would assign to the address foo in obj if and only if it has > not already been assigned. > > var obj = {} > var foo = Math.random() > obj[foo]

Re: Symbols and SymbolAt

2019-09-08 Thread
see https://github.com/tc39/proposal-intl-segmenter 2019年9月9日 1:25 +0900、Dimitrian Nine のメール: > Thanks i found same ideas here: > > https://esdiscuss.org/topic/string-prototype-symbolat-improved-string-prototype-charat > https://esdiscuss.org/topic/working-with-grapheme-clusters > > But topics was

Re: What is holding back Decorators ?

2018-12-03 Thread
For understanding the current status, I think that the following documents will be helpful. The note and slide for the 66th meeting of Ecma TC39 https://github.com/rwaldron/tc39-notes/blob/master/es9/2018-09/sept-26.md#decorators-stage-2-update https://docs.google.com/presentation/d/1s9bu_Z0vWR9

Re: One-shot Delimited Continuations with Effect Handlers

2018-11-06 Thread
Sorry for my hasty reply, the restriction seems to be not related to Algebraic Effects. But I think that Algebraic Effects specifications is useful for a pure implementation. On 2018/11/06 18:44, 森建 wrote: React Hooks, a new feature of React v16.7.0-alpha, is a hacky implementation, so there

Re: One-shot Delimited Continuations with Effect Handlers

2018-11-06 Thread
React Hooks, a new feature of React v16.7.0-alpha, is a hacky implementation, so there are restrictions that must be called in order. https://reactjs.org/docs/hooks-rules.html One of React members says below: > Finally, if you’re a functional programming purist and feel uneasy about React rely

Re: stable sort proposal

2018-09-16 Thread
/2018.4.23/test.js#L64 kai zhu kaizhu...@gmail.com <mailto:kaizhu...@gmail.com> On 12 Sep 2018, at 5:09 AM, 森建 mailto:mori...@kimamass.com>> wrote: `Array#sort` is stable in Chrome 70. https://twitter.com/mathias/status/1036626116654637057 All modern browsers (and IE 11) have stable sort

Re: stable sort proposal

2018-09-11 Thread
`Array#sort` is stable in Chrome 70. https://twitter.com/mathias/status/1036626116654637057 All modern browsers (and IE 11) have stable sort with `Array#sort`. Would you like to mention `Array#sort` must be a stable sort on specification (>=ES2019)? __

Re: Float16Array

2018-07-05 Thread
es so far. I've been trying to get some traction for the feature with implementors but it's being hard to get everyone positive about this being a native implementation rather than a non-native custom API. On Sun, May 27, 2018 at 7:09 PM, 森建 mailto:mori...@kimamass.com>> wrot

Re: Float16Array

2018-05-27 Thread
Any update of this topic since 2017-09 TC39 meeting? https://github.com/rwaldron/tc39-notes/blob/637ecb13af98e480cbb0415b9d724365038d4cc0/es8/2017-09/sep-28.md#float16-typed-arrays The proposal for canvas to use float16 in CanvasPixelFormat is being discussed, IMHO `ImageData.data` should return

Proposal: Map#assign

2018-01-18 Thread
Hi there, I want to add `Map#assign` to TC39 Stage 1. ECMAScript `Object` has `Object.assign`. On the other hand `Map` doesn't have assigning method. For example, we must write JavaScript like the following: ```js const mapA = new Map([["foo", 1], ["bar", 2]]); const mapB = new Map([["baz", 3]

Spaceship Operator

2017-06-27 Thread
PHP, Ruby, Groovy have spaceship operator `<=>`. In short, this operator compares values and returns `1`, `-1`, `0`. ECMAScript spec's `TypedArray#sort` has the default comparison part like following code, so I think it's useful that appending spaceship operator to ECMAScript like it. http://

Re: Letting RegExp method return something iterable?

2017-06-18 Thread
@Oriol Thanks for your reply! On 2017/06/18 21:33, Oriol _ wrote: There is a `String#matchAll` proposal in stage 1. https://github.com/tc39/String.prototype.matchAll https://github.com/tc39/String.prototype.matchAll> Oriol ___ es-discuss mailing l

Re: Re: Letting RegExp method return something iterable?

2017-06-18 Thread
Although It seems that some people agreed with appending `RegExp#execAll` to EcmaScript 4 years ago, what happened to it after that? topic: https://esdiscuss.org/topic/letting-regexp-method-return-something-iterable implementation: https://www.npmjs.com/package/regexp.execall

Re: Re: Float16Array

2017-05-17 Thread
I created a float16 package. https://www.npmjs.com/package/@petamoriken/float16 It exports `Float16Array`, `DataView` methods (`getFloat16`, `setFloat16`) and hfround like `Math.frond`. If there is a chance, please appned EcmaScript Stage 0. ___ es-

Re: Proxyable TypedArray

2017-04-29 Thread
roxy.map(e => e + 1); // -> Uint8Array [2, 3, 4, 5] for(const val of proxy) { console.log(val); // -> 1, 2, 3, 4 } ``` On 2017/04/29 22:27, 森建 wrote: Hi there! Proxy of TypedArray doesn't have [[TypedArrayName]] and [[ViewedArrayBuffer]] slots. so maybe, [22.2.3.5.1 Valida

Proxyable TypedArray

2017-04-29 Thread
Hi there! Proxy of TypedArray doesn't have [[TypedArrayName]] and [[ViewedArrayBuffer]] slots. so maybe, [22.2.3.5.1 ValidateTypedArray](http://www.ecma-international.org/ecma-262/7.0/#sec-validatetypedarray) throws TypeError like following code. ```js const uint8 = new Uint8Array([1, 2,

Re: Re: Float16Array

2017-04-09 Thread
WebGL 2.0 supports half-precision float (16bit float) by default. But now, we must use the following dirty hack using `Uint16Array`. ```js // ref: http://stackoverflow.com/questions/32633585/how-do-you-convert-to-half-floats-in-javascript var toHalf = (function() { var floatView = new Float

Re: Suggest WeakMap.prototype.values()

2016-08-27 Thread
IMHO, it should be resolved in `WeakRefs` (Stage 1). https://github.com/tc39/proposal-weakrefs 2016/08/26 17:19、Michał Wadas のメッセージ: > For your case I would suggest deterministic scope for objects via promises > and reference counting across workers. For your case you don't need to really >

stable sort proposal

2016-03-10 Thread
EcmaScript hasn't have the stable sort method yet. http://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.sort Sure, we can create stable sort function by using `Array#sort`, by returning the number of index (e.g. `arr.indexOf(arguments[0]) - arr.indexOf(arguments[1])`) when it is eq

Re: Syntax Sugar for protected state

2016-02-19 Thread
Does anyone help me with being TC39 champion for my personal protected state strawman? https://github.com/petamoriken/es-protected-state On 2016/01/20 1:43, 森建 wrote: > @Andrea Giammarchi > > Thank you for supporting my code, I got JavaScript knowledge a lot! > > @Subscribers

Re: Syntax Sugar for protected state

2016-01-22 Thread
: https://github.com/wycats/javascript-private-state On Tue, Jan 19, 2016 at 8:43 AM, 森建 mailto:mori...@kimamass.com>> wrote: @Andrea Giammarchi Thank you for supporting my code, I got JavaScript knowledge a lot! @Subscribers If there is not any problems, would you kindly d

Re: Syntax Sugar for protected state

2016-01-19 Thread
@Andrea Giammarchi Thank you for supporting my code, I got JavaScript knowledge a lot! @Subscribers If there is not any problems, would you kindly discuss about this syntax sugar? ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla

Re: Syntax Sugar for protected state

2016-01-19 Thread
maybe okay. ```js "use strict"; // utility function createProtectedStorage() { const wm = new WeakMap(); return (self, protectedClass) => { const map = wm.get(self); if(protectedClass == null) { if(map) { return map; } else { const ret = Object.create(nu

Re: Syntax Sugar for protected state

2016-01-19 Thread
Sorry, I must use `Object.getOwnPropertySymbols`. ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Syntax Sugar for protected state

2016-01-19 Thread
I make it! ```js "use strict"; // utility function createProtectedStorage() { const wm = new WeakMap(); return (self, protectedClass) => { const map = wm.get(self); if(protectedClass == null) { if(map) { return map; } else { const ret = Object.create(nul

Re: Syntax Sugar for protected state

2016-01-19 Thread
Sorry, I misunderstood descriptor and accessor. I try it!! ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Re: Syntax Sugar for protected state

2016-01-19 Thread
@Thomas >Could this be achieved with decorators? I want to get Syntax Sugar. But I didn't have an idea using decorators, thank you! @kdex >About your nomenclature: Why name it `protected` rather than `private`? Am I missing a key difference between the two here? This is not `private` proposal

Syntax Sugar for protected state

2016-01-19 Thread
Dear ES discuss subscribers, I'm Kenta Moriuchi, Department of Art and Information Design Kyushu University in Japan I propose `Protected State`. In ES2015: ```js // utility function createProtectedStorage() { const wm = new WeakMap(); return (self, protectedClass) => { const m