These are chat archives for gkz/LiveScript

26th
Jun 2016
austinfrey
@austinfrey
Jun 26 2016 16:31
This message was deleted
If I were to compare a function definition in Python to on ein Livescript, python wants you to add self to the argument list. Am I correct in thinkin that in livescript this is just assumed?
Riley Cat
@WreckedAvent
Jun 26 2016 22:20
in non ES6 javascript, all functions have a this context automatically, just depends on the context of the call site that determines what it points to
austinfrey
@austinfrey
Jun 26 2016 22:21
Thanks for the input.
Riley Cat
@WreckedAvent
Jun 26 2016 22:21
say-hello = -> @name

bob = 
  name: \bob

bob.say-hello = say-hello

bob.say-hello! |> console.log
prints "bob"
you can use constructors and prototypes to avoid manually setting functions on objects like that.
austinfrey
@austinfrey
Jun 26 2016 22:25
Ahh, cool.Thanks