Skip to main content
12 events
when toggle format what by license comment
Aug 29, 2015 at 14:09 vote accept codez
S Aug 24, 2015 at 12:33 history mod moved comments to chat
S Aug 24, 2015 at 12:33 comment added Mathieu Guindon Comments are not for extended discussion; this conversation has been moved to chat.
Aug 24, 2015 at 8:32 comment added Caridorc @HassanAlthaf Yes, either $0 implicitly or a name in parenthesis like {(n) in n * 2}
Aug 24, 2015 at 8:31 comment added codez @Cardorc And does $0 represent an element in the array?
Aug 24, 2015 at 8:30 comment added Caridorc @HassanAlthaf map applies a function to all the items of a list. [1, 2, 3].map{ $0 * 2 } == [2, 4, 6]
Aug 24, 2015 at 8:29 comment added codez @Caridorc Can you please explain the .map() thingy to me, it is total greek to me. What do you call that? I want to check it out.
Aug 24, 2015 at 7:16 comment added Caridorc @nhgrif It has less syntactical tokens though, succintness is power. (I find it very easy to read)
Aug 23, 2015 at 21:11 comment added nhgrif I'm not sure I agree that return (1...1000).map{count(convertIntegerToWords($0)}.sum is a simplification of anything. The gymnastics you have to do to unwrap this line and figure out what's actually going on is exhausting.
Aug 23, 2015 at 19:35 history edited Caridorc CC BY-SA 3.0
added 303 characters in body; added 18 characters in body
Aug 23, 2015 at 19:29 history edited Caridorc CC BY-SA 3.0
added 159 characters in body; added 119 characters in body
Aug 23, 2015 at 19:22 history answered Caridorc CC BY-SA 3.0