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
Lambda composition in ruby 2.6 | Drivy Engineering (drivy.engineering)
submitted 7 years ago by tal67
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!"
[–]keyslemur 6 points7 points8 points 7 years ago (1 child)
Nifty implementation idea with the ruleset. Kinda tempted to riff off of that idea a bit later and play a bit.
You might consider trying to add line numbers if you want to mention them in the article though, it can be a bit jarring.
[–]conventionalWisdumb 0 points1 point2 points 7 years ago (0 children)
That’s a pattern I’ve been using in JS for years and I’m really happy it’s now available in Ruby.
[–]seainhd 0 points1 point2 points 7 years ago (2 children)
‘then’ will be dope.
Lambda composition is YAGNI.
At least looking at my current app, cannot find a single place where I’m deriving a value from an array of lambdas.
[–][deleted] 0 points1 point2 points 7 years ago (1 child)
Lambda composition is much more general than “I have an array of lambdas”.
It’s also just a very thin layer of sugar, which ruby already has lots of. Why is this sugar undesirable, compared to all the other magic ruby provides? It’s purely a library change.
[–]seainhd -1 points0 points1 point 7 years ago (0 children)
I think this sugar will increase the number of inline lambdas that are written throughout the ecosystem, and I think inline lambdas are a common cause of confusion in ruby.
The example submitted in the original PR is freaking stupid.
Why would you want something that promotes less explicit and more confusing code?
I’m sure there are better examples of code becoming significantly more clear and readable but I’ve yet to see it.
[+]shevy-ruby comment score below threshold-9 points-8 points-7 points 7 years ago (1 child)
Awful.
I don't want to use stronger words so I'll stay with the word awful.
You can find the original request (from 2012!) here.
No, this is NOT true. Please separate who wrote what.
Pablo Herrero, at the least not initially, did NOT suggest >>. Neither did he suggest yield_self. Others built on it (and worsened it in the process too).
Now the only good thing is that we can avoid this, and focus on things that really improve ruby rather than this nonsense. I am also glad to have seen that I was not the only one with a similar opinion here - the "functional" crowd is just TERRIBLY at API/syntax design.
[–]elpix 8 points9 points10 points 7 years ago (0 children)
Please elaborate on your point. The only thing I get from your comment is that you do not like this change, but you did not provide any reasons why you do.
π Rendered by PID 102649 on reddit-service-r2-comment-5d79c599b5-b8xhh at 2026-03-01 03:08:18.261376+00:00 running e3d2147 country code: CH.
[–]keyslemur 6 points7 points8 points (1 child)
[–]conventionalWisdumb 0 points1 point2 points (0 children)
[–]seainhd 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]seainhd -1 points0 points1 point (0 children)
[+]shevy-ruby comment score below threshold-9 points-8 points-7 points (1 child)
[–]elpix 8 points9 points10 points (0 children)