Re: Fwd: Boolean equivalent to pre-increment and post-icnrement

2018-08-29 Thread Sebastian Malton
Then cannot you just write `if (!(bool = !bool))` ?Sebastian Malton

Re: Math.roundUp(), an alias for Math.ceil()

2018-08-04 Thread Sebastian Malton
It also isn't the just the C language, those are the terms for rounding in mathematics which is why they are used.Sebastian

Re: Suggested Enhancement to ecmascript

2018-05-11 Thread Sebastian Malton
.Sebastian MaltonFrom: pranay...@gmail.comSent: May 11, 2018 6:05 PMTo: michalwa...@gmail.comCc: es-discuss@mozilla.org

Iterator Functions

2018-04-16 Thread Sebastian Malton
). Sebastian Malton ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: EcmaScript Proposal - Promised functions

2018-04-12 Thread Sebastian Malton
ction call and the postpends the parameters with a suitable callback function  Sebast

Set functions

2018-04-10 Thread Sebastian Malton
for it too.The following functions I propose adding to Sets.1. Union2. Intersection 3. Difference 4. Symmetric Difference 5. ForEach6. Map7. Every8. Filter9. Find10. Some Sebastian Malton ___ es-discuss mailing list es-discuss

Re: Import from project root

2018-03-29 Thread Sebastian Malton
No because this is something that I am proposing as an extension to es import/exportSebastian Malton

Promise.taggedRace

2018-03-28 Thread Sebastian Malton
. Sebastian Malton ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org

Import from project root

2018-03-28 Thread Sebastian Malton
Sebastian Malton ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Fwd: Array additions

2018-03-26 Thread Sebastian Malton
be `this` instead of `undefined`. Sebastian Malton   Original Message   From: isiahmead...@gmail.com Sent: March 26, 2018 2:49 AM To: es-discuss@mozilla.org Subject: Fwd: Array additions I have a few (typed) array additions I'd like to see added, detailed in this repo. By any chance, how many of these do

Allow Object Destructoring when assigning

2018-03-22 Thread Sebastian Malton
;}```Sebastian Malton ___ es-discuss mailing list es-discuss@mozilla.org https

Re: Proposal: if variable initialization

2018-03-21 Thread Sebastian Malton
Sorry if I missed a message but would such an initialization be only available in the first `if` block or also in the subsequent `else if` and `else` blocks? Sebastian Malton   Original Message   From: isiahmead...@gmail.com Sent: March 21, 2018 6:18 PM To: mikesam...@gmail.com Cc: sebast

Yank Named and Assigned Functions

2018-03-21 Thread Sebastian Malton
to export it but that seems clunky  Sebastian Malton ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Proposal: if variable initialization

2018-03-21 Thread Sebastian Malton
Sebastian MaltonFrom: kaizhu...@gmail.comSent: March 21, 2018 1:21

Re: Pointers

2018-03-19 Thread Sebastian Malton
Yes that is basically what I want anyway Sebastian Malton

Pointers

2018-03-19 Thread Sebastian Malton
= obj.field.name.fullname;```Here if `name` is updated or if `obj.field.name.fullname` is updated so is the other.Sebastian Malton

Re: Expanding Object Shorthand

2018-03-17 Thread Sebastian Malton
. Sebastian MaltonFrom: r...@gol.comSent: March 17, 2018 12:19 AMTo: sebast

Re: Expanding Object Shorthand

2018-03-16 Thread Sebastian Malton
Sebastian Malton   Original Message   From: jackalm...@gmail.com Sent: March 16, 2018 5:26 PM To: sebast...@malton.name Cc: es-discuss@mozilla.org Subject: Re: Expanding Object Shorthand On Fri, Mar 16, 2018 at 1:58 PM, Sebastian Malton <sebast...@malton.name> wrote: > Yes that is

Re: Expanding Object Shorthand

2018-03-16 Thread Sebastian Malton
Yes that is possible but what if you want to do the following? ``` var a = { b: B.b, c: B.c, d: B.d, e: B.e }; ``` Would it not be easier to do the following? ``` var a = { { b, c, d, e }: B }; ``` Sebastian Malton   Original Message   From: jackalm...@gmail.com Sent

Expanding Object Shorthand

2018-03-16 Thread Sebastian Malton
.Sebastian Malton ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org

For-has-in loop

2018-02-19 Thread Sebastian Malton
;    }    }```Sebastian Malton ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Proposal: Object.path([ ... ], defaultValue)

2018-02-15 Thread Sebastian Malton
This would be redundant because of the `?.` operator once it gets mergedSebastian Malton

New operator

2018-02-13 Thread Sebastian Malton
w Operator:```jsmyVar ||= "default" ;``` Sebastian Malton ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: A way to prevent properties to be added to an object if they are null or undefined.

2017-11-28 Thread Sebastian Malton
`.Sebastian MaltonFrom: rodrigocarra...@outlook.comSent: November 28, 2017 8:40 PMTo: sebast...@malton.nameCc: es-discuss

Re: A way to prevent properties to be added to an object if they are null or undefined.

2017-11-28 Thread Sebastian Malton
? Sebastian MaltonFrom: rodrigocarra...@outlook.comSent: November 28, 2017 8:30 PMTo: es-discuss@mozilla.orgSubject: A way to prevent

Break out of non-loops

2017-10-27 Thread Sebastian Malton
Something that is very useful that was recently released into Rust was the idea of using a break statement to break out of the current level. This is already the case for loops but in Rust it was extended to all statements encased in {}.This would make some code a lot easier to understand as it

Re: Extend Object Dereferencing

2017-10-25 Thread Sebastian Malton
...@farsightsoftware.comSent: October 25, 2017 8:10 AMTo: sebast...@malton.nameCc: es-discuss@mozilla.orgSubject: Re: Extend Object Dereferencing On Tue, Oct 24, 2017 at 7:51 PM, Sebastian Malton<sebast...@malton.name> wrote:>> Currently you can do the following >> const {abc, xyz, qnc

Re: Extend Object Dereferencing

2017-10-24 Thread Sebastian Malton
o ```const a = {b: e.b, c: e.c, d: e.d, g: k.g, h: k.h, i: k.i};```BobOn Wed, Oct 25, 2017 at 12:39 AM, Sebastian Malton <sebast...@malton.name> wrote: I guess I do except for the second part```const a

Re: Extend Object Dereferencing

2017-10-24 Thread Sebastian Malton
{abc, xyz, qnc: {awj}} = obj;```On Wed, Oct 25, 2017 at 12:22 AM, Sebastian Malton <sebast...@malton.name> wrote: This could also be extended to help with cleansing objects.const abc = {cde, def, efg} = obj;Would create an object abc with only those three

Re: Extend Object Dereferencing

2017-10-24 Thread Sebastian Malton
This could also be extended to help with cleansing objects.const abc = {cde, def, efg} = obj;Would create an object abc with only those three fields in it.

Extend Object Dereferencing

2017-10-24 Thread Sebastian Malton
Currently you can do the following const {abc, xyz, qnc} = obj;However if you want to go more than one level deep then you have to do it again for each level.I therefore propose the ability to do the following const {abc, xyz, qnc.awj} = obj;And this would create the variables 'abc'', 'xyz',

Re: Proposal: result-forwarding ternary operator

2017-09-19 Thread Sebastian Malton
I don't think that talking about the syntax is relevant now since it is not important when talking about the reasonability of a suggestion. Saying that the syntax could be `?|`The `do` is much longer than the example. I think that this a reasonable idea.

Re: super return

2017-08-30 Thread Sebastian Malton
:DOn Tue, 29 Aug 2017 at 16:57, Allen Wirfs-Brock <al...@wirfs-brock.com> wrote:On Aug 28, 2017, at 12:29 PM, Sebastian Malton <sebast...@malton.name> wrote:The outcome of this basically means "return from current context up one level and then return from there”.This would be a t

Re: super return

2017-08-29 Thread Sebastian Malton
:29, Sebastian Malton <sebast...@malton.name> wrote: Thus I propose the new syntax `super return` and any other positive number of supers. This syntax is currently not valid in any scenario and with the current meaning of super seems, to me at least, relativity easy to understand. The o

Re: Super function

2017-08-28 Thread Sebastian Malton
This is actually exactly what I meant but it looks a lot better. It is also very clean

Re: super return

2017-08-28 Thread Sebastian Malton
:29 PM, Sebastian Malton <sebast...@malton.name> wrote: > I have seen some people want to modify some of the array prototype > functions, especially forEach, so that returning from them returns a value. > However, I have also seems that this could break things since in some cases,

Re: super return

2017-08-28 Thread Sebastian Malton
Michael J. Ryan - track...@gmail.com - http://tracker1.infoPlease excuse grammar errors and typos, as this message was sent from my phone.On Aug 28, 2017 12:30 PM, "Sebastian Malton" <sebast...@malton.name> wrote: I have seen some people want to modify some of the array prototype functions

super return

2017-08-28 Thread Sebastian Malton
I have seen some people want to modify some of the array prototype functions, especially forEach, so that returning from them returns a value. However, I have also seems that this could break things since in some cases, again forEach, the return value in explicitly defined. Thus I propose the

Re: Strawman: `Function.prototype.try` (or `Function.try`)

2017-08-22 Thread Sebastian Malton
1. What is the difference between "normal" and "return"?2. As previously stated a new type would probably be best since this can be made much better then what is essentially a try/catch.Since try catching is not very efficient it would be better to have some sort of type. However, this leads to

Re: Are objects values?

2017-08-19 Thread Sebastian Malton
Should not a value be able to be changed? I don't believe that you can change a function after definition; you can, however, change a function reference. 

Re: an operator for ignoring any exceptions

2017-08-11 Thread Sebastian Malton
I thought that the consensus was that pattern matching (like match in Rust) was not desirable in JS. I am pretty sure we have had a discussion about it. 

Re: @strict class decorator

2017-08-08 Thread Sebastian Malton
That does sound very useful however it has to work (somehow) with NodeJS where the name of objects can change through requiring. Would the type be the original name or the name in the current file?

Re: Array findLast() and findLastIndex()

2017-08-04 Thread Sebastian Malton
uld it not? On Friday, August 4, 2017 8:35:52 PM CEST Sebastian Malton wrote: > I don't specifically have an exact use case but I can definitely think of > some use cases for them. However, if these sorts of functions also work for > array iterators then a reverse entries functions sh

Re: Array findLast() and findLastIndex()

2017-08-04 Thread Sebastian Malton
uldn't get the same treatment.What's your use case?On Fri, Aug 4, 2017 at 11:19 AM, Sebastian Malton <sebast...@malton.name> wrote: This function would be like find but would iterate from back to front. We already have find/findIndex but unlike indexOf they don't have a last count

Array findLast() and findLastIndex()

2017-08-04 Thread Sebastian Malton
This function would be like find but would iterate from back to front. We already have find/findIndex but unlike indexOf they don't have a last counterpart.Sebastian 

Re: nits on BigInt Proposal

2017-08-04 Thread Sebastian Malton
I remember that was a proposal for operator overloading. Was it decided against? I think that packages could solve this and many other problems if there was overloading. Sebastian 

Re: import.meta and TC39 process as a whole

2017-08-03 Thread Sebastian Malton
I agree. There was a post on those email chain some time ago about moving to another platform. We already have TC39 why not move everything that we do here to there and have PRs be the finalization step. That is what Rust does, what CSS-WG does (sort of)

Re: Migrating to a better communication tool

2017-07-26 Thread Sebastian Malton
I propose something list how rust does it. They have a git repo for RFCs and that allows people to to star it or just follow the ones that they want to follow.Sebastian 

Inline variable dereferencing of object field names

2017-07-23 Thread Sebastian Malton
When creating objects I think that having some notation to make the following easier to readlet query = {    $pull: {}};query[team] = userId;I was thinking of borrowing from the above notation and doing the following:let query = {    $pull: {        [team]: userId    }};

New Array Functions

2017-07-11 Thread Sebastian Malton
Using the ~ to count from the back of the array.Basically ```jslet x = [1,2,3,4,5];x[4] === x[~0] === 5; //I know this is not how JS checking works```Sebastian  ___ es-discuss mailing list es-discuss@mozilla.org

Re: JSON5

2017-07-10 Thread Sebastian Malton
If that is a concern then allow C-style block comments or some other style of block comments Sebastian 

Re: Return value of forEach

2017-07-06 Thread Sebastian Malton
Would allowing for each to have the following two properties also help? 1. Returning a falsy value ends the chain and the next element will not be called 2. Ability to pass in a call back as parameter 4 and if present will stop the next element from being iterated over until the callback is

Re: Pattern matching?

2017-06-30 Thread Sebastian Malton
e value 5.The second clause works the same but recursively.And the third simply checks if obj is equal to 'rof'.Den 30 juni 2017 16:46 skrev "Sebastian Malton" <sebast...@malton.name>: Are you thinking kind of like Rust's match statement? I think that something like that would be quite

Re: Pattern matching?

2017-06-30 Thread Sebastian Malton
Are you thinking kind of like Rust's match statement? I think that something like that would be quite a good addition.Sebastian 

Re: Are thrown errors in a try block considered to be handled even if there's no catch block?

2017-06-23 Thread Sebastian Malton
This looks quite cool but I have a question. Would fixing this allow for non- blocking calls called within a try / catch when throwing an error be caught by that catch statement? 

Re: Allowing object field name shorthand

2017-06-22 Thread Sebastian Malton
: On Thu, Jun 22, 2017 at 7:56 AM, Sebastian Malton <sebast...@malton.name <mailto:sebast...@malton.name>> wrote: I would like to propose that the dot or '.' is allowed in object field names so that the following are allowed. var obj = { field1: "val"

Re: Allowing object field name shorthand

2017-06-22 Thread Sebastian Malton
: June 22, 2017 1:14 PMTo: sebast...@malton.nameCc: es-discuss@mozilla.orgSubject: Re: Allowing object field name shorthand On Thu, Jun 22, 2017 at 5:53 PM, Sebastian Malton <sebast...@malton.name> wrote: I would say that the easiest benefit would be the shorthand.But as I pointed out, it

Re: Allowing object field name shorthand

2017-06-22 Thread Sebastian Malton
only real benefit I see is that it's *slightly* more concise in the case of an object with a single property; but as of even a second property, it's more verbose.Sorry, this ran longer than I meant it to. Not trying to bash the idea, these are just the things that jumped out at me and I type fairly quickly.

Allowing object field name shorthand

2017-06-22 Thread Sebastian Malton
I would like to propose that the dot or '.' is allowed in object field names so that the following are allowed. var obj = {    field1: "val" ,    field2.field3: 3,    field2.field4: true};would become var obj = {    field1: "val" ,    field2: {        field3: 3,        field4: true    }};and