Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Whut

Name: Anonymous 2010-07-20 17:37

So in my quest to become an [s][b][u]Expert[/u] Programmer[/b][/s] rewriting my code to all fit on one line using anonymous functions. Works for c++, python, and javascript stuff. I was wondering if its possible to make and call a lambda function on the same line in ruby?

Name: 2010-07-20 17:45

Name: Anonymous 2010-07-20 17:49

lambda {|x| puts "You suck #{x}"}.call "dicks"

Name: sage 2010-07-20 17:50

super cool thank you!

Name: Anonymous 2010-07-20 17:52

>>3
Fuck me, that's one fucked up set of precedence rules

Name: Anonymous 2010-07-21 0:45

(funcall (lambda (x) (format "You suck ~A" x))
         "dicks")

Name: Anonymous 2010-07-21 12:55

>>6
That's two lines.

Name: Anonymous 2010-07-21 14:11

>>7
I have one word for you ...

Name: Anonymous 2010-11-15 3:19

Name: Anonymous 2010-12-09 3:48

Don't change these.
Name: Email:
Entire Thread Thread List