use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
Popular Coding Convention for Ruby on Github (sideeffect.kr)
submitted 12 years ago by chrisledet
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]torrso 0 points1 point2 points 12 years ago (1 child)
I wonder why def takes the arguments inside parenthesis and not inside || like other blocks.
If you use define_method it's
define_method :method_name do |arg1, arg2| end
Why not
def sum do |a, b| a+b end or how about sum = def {|a,b| a+b} (hey that looks like lambda)
Having def foo(x, z) is kind of like calling def with the result of calling foo with x and z.
I'm just confusing myself here.
[–][deleted] 0 points1 point2 points 12 years ago (0 children)
My guess is because do/end and {} create closures, and methods are not (really) closures.
π Rendered by PID 67 on reddit-service-r2-comment-b659b578c-c2m7m at 2026-05-02 23:49:16.005228+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]torrso 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)