Re: Re: Curried functions

2015-10-19 Thread Hemanth H.M
Something like [curry-this](http://nmotw.in/curry-this) would be nice to have, so we could do something like: ```js const add = ( (a, b, c) => a + b + c )::curry(); ``` On Mon, Oct 19, 2015 at 1:00 PM, Bob Myers wrote: > Of course, faster is always better, and native is

Re: Basic set operations?

2014-06-17 Thread Hemanth H.M
Holy goodness http://www.collectionsjs.com/ On Jun 9, 2014 10:33 PM, Tab Atkins Jr. jackalm...@gmail.com wrote: On Mon, Jun 9, 2014 at 8:33 AM, Erik Arvidsson erik.arvids...@gmail.com wrote: Most of these could just be methods of iterators and then they could be used for different data

Basic set operations?

2014-06-07 Thread Hemanth H.M
Would it be useful to implement basic set operations as below? * merge * subset? * superset? * union * intersection * complements * difference * cartesian * copy So on? -- *'I am what I am because of who we all are'* h3manth.com http://www.h3manth.com *-- Hemanth HM *

Re: Basic set operations?

2014-06-07 Thread Hemanth H.M
of collections down the line like queues, trees, tries, etc On Jun 7, 2014 3:13 PM, Barronville, Jonathan jonat...@belairlabs.com wrote: Yes ... +++1. - Jonathan — Sent from Mailbox https://www.dropbox.com/mailbox On Sat, Jun 7, 2014 at 9:05 AM, Hemanth H.M hemanth...@gmail.com wrote: Would

Re: Idea for ECMAScript 7: Number.compare(a, b)

2014-06-06 Thread Hemanth H.M
Something like: ```js Number.compare = (n1, n2) - (n1 - n2) / Math.abs(n1 - n2) || 0; ``` On Fri, Jun 6, 2014 at 12:40 PM, Mathias Bynens mathi...@opera.com wrote: On 6 Jun 2014, at 01:15, Axel Rauschmayer a...@rauschma.de wrote: It’d be nice to have a built-in way for comparing numbers,

Re: Idea for ECMAScript 7: Number.compare(a, b)

2014-06-06 Thread Hemanth H.M
My bad! Miss read it. ^That still sorts in ascending order only. On Fri, Jun 6, 2014 at 5:08 PM, Hemanth H.M hemanth...@gmail.com wrote: Something like: ```js Number.compare = (n1, n2) - (n1 - n2) / Math.abs(n1 - n2) || 0; ``` On Fri, Jun 6, 2014 at 12:40 PM, Mathias Bynens mathi

Lexical scope while extending prototype?

2014-02-10 Thread Hemanth H.M
I do understand Arrow functions are like built-in functions in that both lack .prototype and any [[Construct]] internal method. But why does the scope refer to the global in case of : ``` String.prototype.repeat = (n) = Array(+n+1).join(this); ES6 .repeat(3); // will result in [object

Re: Lexical scope while extending prototype?

2014-02-10 Thread Hemanth H.M
-in String.prototype.repeat instead. :P 10.02.2014, 12:54, Hemanth H.M hemanth...@gmail.com: I do understand Arrow functions are like built-in functions in that both lack .prototype and any [[Construct]] internal method. But why does the scope refer to the global in case

Re: Lexical scope while extending prototype?

2014-02-10 Thread Hemanth H.M
So to finalize: There is no way to do this with fat arrow, rather fat arrow is not meant for this? On Feb 10, 2014 6:38 PM, Claude Pache claude.pa...@gmail.com wrote: Le 10 févr. 2014 à 09:53, Hemanth H.M hemanth...@gmail.com a écrit : I do understand Arrow functions are like built

Re: Lexical scope while extending prototype?

2014-02-10 Thread Hemanth H.M
On Mon, Feb 10, 2014 at 10:13 PM, Allen Wirfs-Brock al...@wirfs-brock.comwrote: Object.assign(String.prototype, { repeat(n) {return Array(+n+1).join(this)} }); Roger that! -- *'I am what I am because of who we all are'* h3manth.com http://www.h3manth.com *-- Hemanth HM *

shorthand notation for attribute creation?

2014-02-09 Thread Hemanth H.M
Something like `var foo = {}; foo.bar ||= 3` would be very useful. But not sure how something like `obj['name']['maxlength']` be reduced to shorthand check if 'name' is not defined. -- *'I am what I am because of who we all are'* h3manth.com http://www.h3manth.com *-- Hemanth HM *

Re: shorthand notation for attribute creation?

2014-02-09 Thread Hemanth H.M
Giammarchi Sent: Sunday, February 9, 2014 15:29 To: Hemanth H.M Cc: es-discuss Subject: Re: shorthand notation for attribute creation? Unless I misunderstood your idea, `||=` makes me naturally think about `+=` so if `i += n;` means `i = i + n` then `o.name ||= value` means `o.name

Re: Anonymous Generators ?

2013-12-10 Thread Hemanth H.M
Thank you, for making it clear :-) On Tue, Dec 10, 2013 at 5:03 AM, Brendan Eich bren...@mozilla.com wrote: Hemanth H.M wrote: Can this be a pattern in itself or is there any specific name for this paradigm ? Python folks call it coroutines but it's not the canonical meaning

Re: Anonymous Generators ?

2013-12-08 Thread Hemanth H.M
Ah! Sweet :) Makes sense of why send() method was implemented for generators. Can this be a pattern in itself or is there any specific name for this paradigm ? On Sun, Dec 8, 2013 at 3:11 PM, Brendan Eich bren...@mozilla.com wrote: Brendan Eich wrote: How about something like this?

Re: Anonymous Generators ?

2013-12-07 Thread Hemanth H.M
Yes, I'm aware of taskjs. So it's not a good idea to mix streams and generators! Thanks :) On Sun, Dec 8, 2013 at 10:41 AM, Brendan Eich bren...@mozilla.com wrote: Hemanth H.M wrote: Yes, that's where I'm stuck. Here are the few variations I tired : ``` function* FileReader

Re: Anonymous Generators ?

2013-12-07 Thread Hemanth H.M
: Hemanth H.M wrote: Yes, I'm aware of taskjs. So it's not a good idea to mix streams and generators! No, it's important not to think yield from a generator function nested in another will yield from the *outer* one. That seems to be what you thought, in all the variations. Passing a function

Anonymous Generators ?

2013-12-06 Thread Hemanth H.M
``` function* FileReader(){ // Some stream code on node; stream.on('data',function*(data) { yield data; }); } ``` Now : ``` var reader = FileReader(); console.log(reader.next()); // Would say { value: undefined, done: true } ``` The question being, where will the anonymous

var el1,el2 = [1,2] why not?

2012-07-04 Thread Hemanth H.M
Hello Hackers, This might be silly, but let the code speak : var param1,param2 = window.location.search.replace('?','').split('') undefined param1 undefined param2 [foo=bar, hello=world] a=1 1 b=2 2 a,b=b,a 1 a 1 b 2 Why not param1 be equal to foo=bar and param2 be equal to hello=world?

Re: var el1,el2 = [1,2] why not?

2012-07-04 Thread Hemanth H.M
ReferenceError: Invalid left-hand side in assignment on chrome On Wed, Jul 4, 2012 at 10:46 PM, Jussi Kalliokoski jussi.kallioko...@gmail.com wrote: [param1, param2] = window.location.search.replace('?','').split('') -- *'I am what I am because of who we all are'* h3manth.com

Re: var el1,el2 = [1,2] why not?

2012-07-04 Thread Hemanth H.M
not quite there yet. --Oliver On Jul 4, 2012, at 10:08 AM, Hemanth H.M wrote: Hello Hackers, This might be silly, but let the code speak : var param1,param2 = window.location.search.replace('?','').split('') undefined param1 undefined param2 [foo=bar, hello=world] a=1 1 b=2

Re: var el1,el2 = [1,2] why not?

2012-07-04 Thread Hemanth H.M
Thank you all, for your fantastic feedback! On Thu, Jul 5, 2012 at 6:17 AM, Ariya Hidayat ariya.hida...@gmail.comwrote: This might be silly, but let the code speak : var param1,param2 = window.location.search.replace('?','').split('') a,b=b,a To see how a JavaScript parser understands

Return values from callbacks?

2012-06-21 Thread Hemanth H.M
Hello Hackers, If there was a easy way to wrap an asynchronous in a synchronous API would it not be easy? Because we can wrap it that way any API will need to accept a callback to return proceed values. I bit be speaking absolute non sense here, but just felt something like that might makes

Re: Return values from callbacks?

2012-06-21 Thread Hemanth H.M
WOW! Ok, thank you. On Thu, Jun 21, 2012 at 8:32 PM, Brendan Eich bren...@mozilla.org wrote: See dherman's http://taskjs.org/ for one way that ES6 will support, but which requires expliciti 'yield' usage when you wrap to make the preemption point clear. /be Hemanth H.M wrote: Hello

Re: Existential operator (was: ||= is much needed?)

2012-06-19 Thread Hemanth H.M
As there is no keyword as 'or' so far, does something like *x = x.value or 5 *sound better? On Tue, Jun 19, 2012 at 3:00 PM, David Bruant bruan...@gmail.com wrote: What about a more generic operator that would be able to silently absorb any error? let greedy = obj.hints?.greedy; would

Re: Decoupling [ ] and Property Access and the DOM (Was: Why not NodeList#forEach :\?)

2012-06-19 Thread Hemanth H.M
Hoping to see that day soon! :) On Tue, Jun 19, 2012 at 10:01 PM, Erik Arvidsson erik.arvids...@gmail.comwrote: On Tue, Jun 19, 2012 at 8:37 AM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: Actual API design is probably an orthogonal issue. What the Object Model Reformation proposal

Would some like Object.inspect(myObj) be useful?

2012-06-14 Thread Hemanth H.M
Was just wondering if something like *Object.inspect(myObj) *would give all the attributes of that particular object. -- *'I am what I am because of who we all are'* h3manth.com http://www.h3manth.com *-- Hemanth HM * ___ es-discuss mailing list

Re: Would some like Object.inspect(myObj) be useful?

2012-06-14 Thread Hemanth H.M
No there is no proposal of that I'm aware of in Strawman, just asking the group if it's useful? On Thu, Jun 14, 2012 at 3:23 PM, T.J. Crowder t...@crowdersoftware.comwrote: On 14 June 2012 10:42, Hemanth H.M hemanth...@gmail.com wrote: Was just wondering if something like *Object.inspect

Re: Would some like Object.inspect(myObj) be useful?

2012-06-14 Thread Hemanth H.M
The inspect module provides functions for introspecting on live objects and their source code. On Thu, Jun 14, 2012 at 6:21 PM, Russell Leggett russell.legg...@gmail.comwrote: On Thu, Jun 14, 2012 at 5:42 AM, Hemanth H.M hemanth...@gmail.com wrote: Was just wondering if something like

Re: Would some like Object.inspect(myObj) be useful?

2012-06-14 Thread Hemanth H.M
that give o/p like : ('__delslice__', method-wrapper '__delslice__' of list object at 0x1005252d8) On Thu, Jun 14, 2012 at 10:41 PM, Allen Wirfs-Brock al...@wirfs-brock.comwrote: On Jun 14, 2012, at 9:49 AM, Hemanth H.M wrote: The inspect module provides functions for introspecting on live objects

Re: Would some like Object.inspect(myObj) be useful?

2012-06-14 Thread Hemanth H.M
WOW! Thanks a ton for the clarification. On Thu, Jun 14, 2012 at 10:52 PM, Brendan Eich bren...@mozilla.com wrote: ES5 has plural Object.defineProperties for defining more than one property on an object, and of course Object.create that defines all the properties on a new object from a

||= is much needed?

2012-06-12 Thread Hemanth H.M
Would something like : obj[prop] ||= NewProp be useful? -- *'I am what I am because of who we all are'* h3manth.com http://www.h3manth.com *-- Hemanth HM * ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Map#get needs a default value param?

2012-06-12 Thread Hemanth H.M
Would it be useful to have something like sum[value] = sum.get(value, 0) + 1 -- *'I am what I am because of who we all are'* h3manth.com http://www.h3manth.com *-- Hemanth HM * ___ es-discuss mailing list es-discuss@mozilla.org

Re: ||= is much needed?

2012-06-12 Thread Hemanth H.M
Kool, well was looking into use caseswell my first frustration was [1] I'm new to this, how does one write proposals? Is it a wiki? [1] https://twitter.com/GNUmanth/status/208555914733682690 On Tue, Jun 12, 2012 at 8:36 PM, Rick Waldron waldron.r...@gmail.comwrote:

Re: Map#get needs a default value param?

2012-06-12 Thread Hemanth H.M
True! It will be confusing; || is uber kool :) On Tue, Jun 12, 2012 at 9:37 PM, David Bruant bruan...@gmail.com wrote: Le 12/06/2012 18:02, Tab Atkins Jr. a écrit : On Tue, Jun 12, 2012 at 7:36 AM, David Bruantbruan...@gmail.com wrote: Le 12/06/2012 16:19, Hemanth H.M a écrit : Would

Why not NodeList#forEach :\?

2012-06-11 Thread Hemanth H.M
[].forEach.call(NodeList,function(elm) {}) why that? Why not treat it like an [] ? -- *'I am what I am because of who we all are'* h3manth.com http://www.h3manth.com *-- Hemanth HM * ___ es-discuss mailing list es-discuss@mozilla.org

Re: Why not NodeList#forEach :\?

2012-06-11 Thread Hemanth H.M
Thank you very much for the clarification! Also noticed 'Extending the DOM is dangerous.' On Mon, Jun 11, 2012 at 4:16 PM, David Bruant bruan...@gmail.com wrote: Hi, Le 11/06/2012 12:30, Hemanth H.M a écrit : [].forEach.call(NodeList,**function(elm) {}) why that? Why not treat it like

ecmascript 6 annotated available ? EOM

2012-06-11 Thread Hemanth H.M
-- *'I am what I am because of who we all are'* h3manth.com http://www.h3manth.com *-- Hemanth HM * ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Zed A. Shaw - The Web Will Die When OOP Dies

2012-06-11 Thread Hemanth H.M
Well, I came looking for sugar, was reading few of the proposal which already covers my needs, will update as soon as I get anything either than those in the proposal. /me understands that just a video link is too very wage, but, felt it made few strong suggestions. How can one contribute ( as

Re: Why not NodeList#forEach :\?

2012-06-11 Thread Hemanth H.M
Wow, that's interesting. When will that be implemented? On Mon, Jun 11, 2012 at 5:59 PM, Rick Waldron waldron.r...@gmail.comwrote: On Monday, June 11, 2012 at 6:30 AM, Hemanth H.M wrote: [].forEach.call(NodeList,function(elm) {}) why that? Why not treat it like an [] ? ES6 draft specifies

Re: Why not NodeList#forEach :\?

2012-06-11 Thread Hemanth H.M
Uber kool! Thanks a ton David! npm install es6-shim # wow :) Shall blog about this! Well, Map() and Set() is already there is FF13, it's an experimental API right? Experimental means it can be chucked off or it shall be modified drastically ? ( More Java like APIs :\ ) Well {} behaved liked

Re: Why not NodeList#forEach :\?

2012-06-11 Thread Hemanth H.M
Ha Hmm, yet to iterate sets. On Mon, Jun 11, 2012 at 6:48 PM, David Bruant bruan...@gmail.com wrote: http://productforums.google.com/forum/#!topic/docs/0hQWeOvCcHU -- *'I am what I am because of who we all are'* h3manth.com http://www.h3manth.com *-- Hemanth HM *

Re: ecmascript 6 annotated available ? EOM

2012-06-11 Thread Hemanth H.M
Just came across that, thanks :) On Mon, Jun 11, 2012 at 7:17 PM, Rick Waldron waldron.r...@gmail.comwrote: On Mon, Jun 11, 2012 at 6:59 AM, Hemanth H.M hemanth...@gmail.com wrote: The current spec draft is available here: http://wiki.ecmascript.org/doku.php?id

Re: Why not NodeList#forEach :\?

2012-06-11 Thread Hemanth H.M
Thank you Rick Waldron :) BTW tired 'es6-shim' on node.js and : Math.sign(-0) -1 Should it give an error? On Mon, Jun 11, 2012 at 7:14 PM, Rick Waldron waldron.r...@gmail.comwrote: On Mon, Jun 11, 2012 at 9:09 AM, Tom Ellis tellis...@gmail.com wrote: ES6 draft specifies a new Array

Zed A. Shaw - The Web Will Die When OOP Dies

2012-06-10 Thread Hemanth H.M
Sugar, I want more sugar! http://vimeo.com/43380467 -- *'I am what I am because of who we all are'* h3manth.com http://www.h3manth.com *-- Hemanth HM * ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Zed A. Shaw - The Web Will Die When OOP Dies

2012-06-10 Thread Hemanth H.M
discussion: https://twitter.com/zedshaw/status/211591843899654144 Anton On Sunday, June 10, 2012 at 5:27 AM, Hemanth H.M wrote: Sugar, I want more sugar! http://vimeo.com/43380467 -- *'I am what I am because of who we all are'* h3manth.com http://www.h3manth.com *-- Hemanth HM