Re: Dynamic this

2012-04-09 Thread Angus Croll
I like dynamic this. I favor hard-bound lexical |this| for standalone function calls only. Thats where the problems are right now The (this, ...) syntax seems unnecessarily gnarly - better to just default to using base ref as |this| in a method call - since by now this is expected behavior On

Re: Dynamic this

2012-04-09 Thread Russell Leggett
e extra @s all over the place would be too much. - Russ On Mon, Apr 9, 2012 at 1:46 PM, Herby Vojčík wrote: > Hello, > > this is more a conceptual question post. But first some proposals that > circulated in the list: > > 1. Dynamic-this enabled fat arrow functions. > >

Re: Dynamic this

2012-04-09 Thread John J Barton
On Mon, Apr 9, 2012 at 10:46 AM, Herby Vojčík wrote: > Hello, > > this is more a conceptual question post. But first some proposals that > circulated in the list: > > 1. Dynamic-this enabled fat arrow functions. > > (this, ...) => expr > (this, ...) => { b

Dynamic this

2012-04-09 Thread Herby Vojčík
Hello, this is more a conceptual question post. But first some proposals that circulated in the list: 1. Dynamic-this enabled fat arrow functions. (this, ...) => expr (this, ...) => { body } 2. ABC (apply/bind/call) shortcuts. thisobj::identifier(...args) // apply thisobj::iden

Re: Lexical versus dynamic "this"

2011-05-10 Thread Andrew Dupont
On May 10, 2011, at 7:47 PM, Brendan Eich wrote: > Usability is hard. I've seen zero evidence that CoffeeScript's fat-arrow is > unusably terse and people are fooled into thinking it's as cheap as -> (if > that's the concern). What is the problem? The problem comes from my (limited) experience

Re: Lexical versus dynamic "this"

2011-05-10 Thread Axel Rauschmayer
>>> myfunc(param1, param2) -> { ... } // lexical this >>> var obj = { >>> mymethod: (this, param1, param2) -> { ... } // dynamic this >>> } >> >> This is how Python handles methods. I think there were objections to this >> approach,

Re: Lexical versus dynamic "this"

2011-05-10 Thread Brendan Eich
, param2) -> { ... } // lexical this >> var obj = { >>mymethod: (this, param1, param2) -> { ... } // dynamic this >> } > > This is how Python handles methods. I think there were objections to this > approach, but unfortunately I can neither remember them nor f

Lexical versus dynamic "this"

2011-05-10 Thread Axel Rauschmayer
e. Are newbies ever going to be able to handle this? If we are going to overhaul function semantics, wouldn’t it make sense to adopt a more explicit approach? > myfunc(param1, param2) -> { ... } // lexical this > var obj = { > mymethod: (this, param1, param2) -> { ... } /