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 always (?) faster. >

Re: Generators with arrow functions.

2014-09-23 Thread Hemanth H.M
I normally do it, today out of excitement did a mistake, sorry for that! On Sep 23, 2014 7:52 PM, "Brendan Eich" wrote: > Hemanth H.M wrote: > >> > It is one proposed syntax for async functions. >> >> Cool, thanks. >> > > Not sure who wrote the &

Re: Generators with arrow functions.

2014-09-23 Thread Hemanth H.M
> It is one proposed syntax for async functions. Cool, thanks. On Tue, Sep 23, 2014 at 7:30 PM, Jeremy Martin wrote: > This has come up a few times. Check out this thread, for example: > http://esdiscuss.org/topic/generator-arrow-functions. > > On Tue, Sep 23, 2014 at 9:40

Generators with arrow functions.

2014-09-23 Thread Hemanth H.M
Is there a mention about it somewhere? Something like: ``` gen = (x) * => yield x+2; ``` I understand that arrow functions are lexically bound and has an explicitly return in it's a one liner. -- *'I am what I am because of who we all are'* h3manth.com *-- Hemanth HM *

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." wrote: > On Mon, Jun 9, 2014 at 8:33 AM, Erik Arvidsson > wrote: > > Most of these could just be methods of iterators and then they could be > used > > for different data structures seemlessly. > > In other wor

Re: Basic set operations?

2014-06-07 Thread Hemanth H.M
ypes of collections down the line like queues, trees, tries, etc > On Jun 7, 2014 3:13 PM, "Barronville, Jonathan" > wrote: > >> Yes ... +++1. >> >> - Jonathan >> — >> Sent from Mailbox <https://www.dropbox.com/mailbox> >> >> >>

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 *-- Hemanth HM * __

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 wrote: > Something like: > > ```js > Number.compare = (n1, n2) -> (n1 - n2) / Math.abs(n1 - n2) || 0; > ``` > > > > On Fri, Jun 6, 2014 at 12:40 PM, Math

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 wrote: > On 6 Jun 2014, at 01:15, Axel Rauschmayer wrote: > > > It’d be nice to have a built-in way for comparing numbers, e.g. when > sorting arrays. >

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 wrote: > 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 *-- Hemanth HM * _

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" wrote: > > Le 10 févr. 2014 à 09:53, Hemanth H.M a écrit : > > I do understand Arrow functions are like built-in functions in that

Re: Lexical scope while extending prototype?

2014-02-10 Thread Hemanth H.M
dow as well. But second case won't get > executed, because you're running built-in String.prototype.repeat instead. > :P > > > 10.02.2014, 12:54, "Hemanth H.M" : > > I do understand Arrow functions are like built-in functions in that both > lack .prototype and any [[C

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 Windo

Re: shorthand notation for attribute creation?

2014-02-09 Thread Hemanth H.M
like >> >> ```js >> function f(foo = true, { bar = 5, baz = "ten" } = {}) { >> console.log(foo, bar, baz); >> } >> ``` >> >> From: es-discuss [mailto:es-discuss-boun...@mozilla.org] On Behalf Of >> Andrea Giammarchi >> Sent: Sun

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 *-- Hemanth HM * __

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 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&#x

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 wrote: > Brendan Eich wrote: > >> How about something like this? >> >> spawn(function *(

Re: Anonymous Generators ?

2013-12-07 Thread Hemanth H.M
I was absolutely under that assumption. Streams allow the event loop to run between iterations, unlike yield, that's where it gets tricky and converting a stream based logic to task.js isn't straight forward. On Sun, Dec 8, 2013 at 11:24 AM, Brendan Eich wrote: > Hema

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 wrote: > Hemanth H.M wrote: > >> Yes, that's where I'm stuck. >> >> Here are the few variations

Re: Anonymous Generators ?

2013-12-07 Thread Hemanth H.M
nerators will not help to iterator over the nested/child anonymous generators? On Sat, Dec 7, 2013 at 10:13 PM, Brendan Eich wrote: > Hemanth H.M wrote: > >> function* FileReader(){ >> // Some stream code on node; >> stream.on('data',function*(data

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 f

Re: HTML version of the ES6 draft

2013-07-24 Thread Hemanth H.M
http://esdiscuss.org/topic/new-es6-draft-now-available-rev-16 Might be useful for you. On Wed, Jul 24, 2013 at 10:16 PM, John Lenz wrote: > Any chance we can get an official HTML version of the draft specs? > > This is out of date: > http://people.mozilla.org/~jorendorff/es6-draft.html > > It i

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 wrote: > > 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 the semantic

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

2012-07-04 Thread Hemanth H.M
; var [a, b] = foo; > > which is what you want, but we're 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.locatio

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

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

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 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 &

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 thing

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 wrote: > On Tue, Jun 19, 2012 at 8:37 AM, Allen Wirfs-Brock > wrote: > > Actual API "design" is probably an orthogonal issue. What the "Object > Model Reformation" proposal (which is probably better understood by i

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 wrote: > What about a more generic operator that would be able to silently absorb > any error? > >let greedy = obj.hints?.greedy; > > would become: > >

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 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 descriptor-map. But it

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

2012-06-14 Thread Hemanth H.M
s a String, where as get is a function. Compared to something like inspect module in python that give o/p like : ('__delslice__', ) On Thu, Jun 14, 2012 at 10:41 PM, Allen Wirfs-Brock wrote: > > On Jun 14, 2012, at 9:49 AM, Hemanth H.M wrote: > > The inspect module provid

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 wrote: > On Thu, Jun 14, 2012 at 5:42 AM, Hemanth H.M wrote: > >> Was just wondering if something like *Object.inspect(myObj) *would giv

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 wrote: > On 14 June 2012 10:42, Hemanth H.M wrote: > >> Was just wondering if something like *Object.inspect(myObj) *would give &g

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 *-- Hemanth HM * ___ es-discuss mailing list es-di

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 wrote: > Le 12/06/2012 18:02, Tab Atkins Jr. a écrit : > > On Tue, Jun 12, 2012 at 7:36 AM, David Bruant wrote: >> >>> Le 12/06/2012 16:19, Hemanth H.M a écrit : >>&g

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 wrote: > http://wiki.ecmascript.org/doku.php?id=strawm

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 *-- Hemanth HM * ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.or

||= 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 *-- Hemanth HM * ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-di

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 wrote: > > > On Mon, Jun 11, 2012 at 9:09 AM, Tom Ellis wrote: > >> > ES6 draft specifies a new Array constructor called Array.from that w

Re: ecmascript 6 annotated available ?

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

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 *-- Hemanth HM * __

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 ma

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 wrote: > > 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 d

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 in

ecmascript 6 annotated available ?

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

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 wrote: > Hi, > > Le 11/06/2012 12:30, Hemanth H.M a écrit : > > [].forEach.call(NodeList,**function(elm) {}) why that? Wh

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 *-- Hemanth HM * ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozi

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

2012-06-10 Thread Hemanth H.M
> > Related 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 o

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

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