Feedback on Iterable Numbers Proposal?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Feedback on Iterable Numbers Proposal?

John Henry
Howdy!,

My name is John and I have a (hopefully non-contentious) addition for the ECMA Script Language described here: https://github.com/johnhenry/make-numbers-iterable. I wonder if there are good folks out there willing to give me feedback? I also wonder if someone might be willing to champion the proposal as described here: https://github.com/tc39/proposals/blob/master/CONTRIBUTING.md

Thanks,
-- John

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Feedback on Iterable Numbers Proposal?

kdex
I like this proposal a lot!

The only thing I'd like to remark is that I can see people getting confused about the exact range that you're iterating over.
Some languages provide constructs to include/exclude the last element in the range.

On Sunday, February 26, 2017 8:00:39 PM CET John Henry wrote:

> Howdy!,
>
> My name is John and I have a (hopefully non-contentious) addition for the
> ECMA Script Language described here:
> https://github.com/johnhenry/make-numbers-iterable. I wonder if there are
> good folks out there willing to give me feedback? I also wonder if someone
> might be willing to champion the proposal as described here:
> https://github.com/tc39/proposals/blob/master/CONTRIBUTING.md
>
> Thanks,
> -- John
>
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Feedback on Iterable Numbers Proposal?

kdex
On that note, it might make more sense to add range literals.

On Sunday, February 26, 2017 8:39:28 PM CET kdex wrote:

> I like this proposal a lot!
>
> The only thing I'd like to remark is that I can see people getting confused about the exact range that you're iterating over.
> Some languages provide constructs to include/exclude the last element in the range.
>
> On Sunday, February 26, 2017 8:00:39 PM CET John Henry wrote:
> > Howdy!,
> >
> > My name is John and I have a (hopefully non-contentious) addition for the
> > ECMA Script Language described here:
> > https://github.com/johnhenry/make-numbers-iterable. I wonder if there are
> > good folks out there willing to give me feedback? I also wonder if someone
> > might be willing to champion the proposal as described here:
> > https://github.com/tc39/proposals/blob/master/CONTRIBUTING.md
> >
> > Thanks,
> > -- John
> >
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Feedback on Iterable Numbers Proposal?

kdex
In reply to this post by kdex
On that note, it might make more sense to add range literals.

On Sunday, February 26, 2017 8:39:28 PM CET kdex wrote:

> I like this proposal a lot!
>
> The only thing I'd like to remark is that I can see people getting confused about the exact range that you're iterating over.
> Some languages provide constructs to include/exclude the last element in the range.
>
> On Sunday, February 26, 2017 8:00:39 PM CET John Henry wrote:
> > Howdy!,
> >
> > My name is John and I have a (hopefully non-contentious) addition for the
> > ECMA Script Language described here:
> > https://github.com/johnhenry/make-numbers-iterable. I wonder if there are
> > good folks out there willing to give me feedback? I also wonder if someone
> > might be willing to champion the proposal as described here:
> > https://github.com/tc39/proposals/blob/master/CONTRIBUTING.md
> >
> > Thanks,
> > -- John
> >
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Feedback on Iterable Numbers Proposal?

Dean Tribble-2
In reply to this post by John Henry
A Range type seems to me clearer, more powerful, and less magical.  Even without syntax, the clarity seems better:

//for-of syntax
for (const i of Range.upto(5)){
  //do something with i
}

for(const i of Range.from(3, 15)){
  //do something with i
}  

Whether Range's are a class or it's just a set of iterator constructors depends on what else you can do with it. The larger proposed change does not seem to me like it offsets the confusion introduced by magical syntax (e.g., what is the result of new Array(4)?)



On Sun, Feb 26, 2017 at 11:00 AM, John Henry <[hidden email]> wrote:
Howdy!,

My name is John and I have a (hopefully non-contentious) addition for the ECMA Script Language described here: https://github.com/johnhenry/make-numbers-iterable. I wonder if there are good folks out there willing to give me feedback? I also wonder if someone might be willing to champion the proposal as described here: https://github.com/tc39/proposals/blob/master/CONTRIBUTING.md

Thanks,
-- John

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss



_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Feedback on Iterable Numbers Proposal?

T.J. Crowder-2
In reply to this post by kdex
On Sun, Feb 26, 2017 at 7:40 PM, kdex <[hidden email]> wrote:
On that note, it might make more sense to add range literals.

That was my thought as well -- or at least, ranges if not range literals. (A simple `Range` is trivial to implement, but I'd rather see something ubiquitous.) I don't see any active, inactive, stage 0, or finished proposals for ranges (they have been discussed: https://esdiscuss.org/topic/ranges).

John, to my mind it'd be great to see this same great level of attention-to-detail, research, etc., devoted to ranges. I think iterable numbers would be too limited to be all that useful (although a subset of your proposal would be really simple to add). But I'm just a random guy on the list, no idea if the people who actually matter would be interested in a range proposal. Ranges have been put to good use in other languages/environments (some mentioned in your proposal), so...

-- T.J.

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Feedback on Iterable Numbers Proposal?

liorean
> On Sun, Feb 26, 2017 at 7:40 PM, kdex <[hidden email]> wrote:
>> On that note, it might make more sense to add range literals.

On 26 February 2017 at 20:50, T.J. Crowder
<[hidden email]> wrote:

> That was my thought as well -- or at least, ranges if not range literals. (A
> simple `Range` is trivial to implement, but I'd rather see something
> ubiquitous.) I don't see any active, inactive, stage 0, or finished
> proposals for ranges (they have been discussed:
> https://esdiscuss.org/topic/ranges).
>
> John, to my mind it'd be great to see this same great level of
> attention-to-detail, research, etc., devoted to ranges. I think iterable
> numbers would be too limited to be all that useful (although a subset of
> your proposal would be really simple to add). But I'm just a random guy on
> the list, no idea if the people who actually matter would be interested in a
> range proposal. Ranges have been put to good use in other
> languages/environments (some mentioned in your proposal), so...

I'd like to bring us back a decade for a while:

Lars T Hansen 2007/07/16 13:33
>Multi-dimensional arrays
>
>Consider matrices of floating-point numbers, which we can type as [][double], allocate using x = new [][double](5,8), and dereference as x[1][5]. We can extract subarrays using x[2:4][1:3], maybe (creating a 2×2 matrix). This should not be important for ES4 but it might be important to make sure we can consider it for ES5, somehow.


And https://web.archive.org/web/20160425221208/http://wiki.ecmascript.org/doku.php?id=discussion:slice_syntax


The combining of these two features would be a match made in heaven,
and be able to provide Ranges.
--
David "liorean" Andersson
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Loading...