<    March 2017    >
Su Mo Tu We Th Fr Sa  
          1  2  3  4  
 5  6  7  8  9 10 11  
12 13 14 15 16 17 18  
19 20 21 22 23 24 25  
_2_6 27 28 29 30 31
00:47 sz0 joined
01:05 Gustavo6046 joined
02:12 netj joined
06:00 vlad1777d joined
07:15 ninegrid joined
07:25 dade` joined
08:28 tvw joined
09:07 scippio joined
10:18 netj joined
10:44 vlad1777d joined
13:18 tvw joined
13:19 lilmonkey joined
14:10 vlad1777d joined
14:59 sz0 joined
15:34 Gustavo6046 joined
15:51 creature joined
15:52 <creature> Hi. I'm creating a class definition that's got a bunch of similar functions in it, and I'd like to DRY it up by having a helper function that returns another function. I can't seem to get the syntax right for this; any tips?
15:53 <creature> (eg. `_shouty: (name) -> -> "HELLO #{name.toUpper()}"`; `shoutAtMark: @_shouty("Mark"); shoutAtFred: @_shouty("Fred")`)
16:23 Gustavo6046_ joined
17:01 scippio joined
17:32 BearishMushroom joined
17:39 Gustavo6046 joined
17:41 ninegrid joined
17:41 <thurloat> creature something like this: https://goo.gl/AZNtb1 ?
17:42 <thurloat> sorry, wrong link. https://goo.gl/yTJBEj is right
17:42 <thurloat> thought coffeescript.org updated the url as you went
18:15 sz0 joined
18:47 <creature> thurloat: That's what I've currently got, I was just thinking about optimising it. I might be trying to make things too clever, though.
18:47 <creature> Your `_shouty` function is slightly different to mine; mine returns a function. Hold on, I'll do a Coffeescript gist for it.
18:49 <creature> http://bit.ly/2mVkp9S
18:49 <creature> That's what I tried. That doesn't run, though.
18:57 <deltab> _shouty = (name) -> -> "HELLO #{name.toUpperCase()}"
18:57 <deltab> shoutAtMark: _shouty "Mark"
18:58 <deltab> assuming you don't also want _shouty as a method
19:00 s2013 joined
19:04 <thurloat> ah i hear you creature
19:04 <thurloat> like this: https://goo.gl/hvBDov
19:05 <creature> Ah ha!
19:08 <creature> Thank you, that's perfect.
19:08 <creature> deltab: Thanks too. :) I wanted to keep it encapsulated within my class, rather than have it floating around the global namespace.
19:15 <deltab> it's not in the global namespace either way
19:17 <deltab> you can have it in the prototype (accessible through all instances), as a property of the class (accessible through the class), or local (not accessible outside the class)
19:19 <creature> Good point, I hadn't quite grasped that correctly. :)
19:40 netj joined
19:47 tvw joined
21:32 Lieuwex joined