News for hackers. Stuff that matters.
Re:My Mixed Feelings about Ruby by tokipin on Monday June 30, 2008 @02:49PM (#232277)
i haven't used ruby excessively, but one example i found just by looking at it a bit is that blocks are redundant with lambdas

to me it seems the language is trying to promote higher-level programming by making what is perhaps a common usage of first-class functions more explicit. but i can't say this is necessarily the best choice

another thing is lambdas are poorly-implemented, requiring the .call thing (perhaps due to the parens-less function calls.) this matters to me because i use a lot of first-class function stuff

for personal coding i use Lua, which to me feels more powerful than Ruby (from the perspective of abstractive power,) yet is much more streamlined

Re:My Mixed Feelings about Ruby by raganwald on Monday June 30, 2008 @02:59PM (#232287)
blocks are redundant with lambdas

Except the semantics of the return keyword are corrupted if you get rid of blocks and procs while keeping lambdas. Makes me think return isn't worth the bother, but then again lots of people would hate a language without a return keyword.

Re:My Mixed Feelings about Ruby by gunderson on Monday June 30, 2008 @03:09PM (#232303)
I wouldn't say corrupted, just different. I imagine there are many cases in which the different semantics are used intentionally.

This is really not a huge issue, b/c anyone who has worked with Ruby enough knows about it. It's mainly that the difference doesn't really make logical sense -- why would a "proc" behave differently from a "lambda"? Also note that:

  lamba { foo } 
means exactly the same as

  proc { foo }
which is different than:

  Proc.new { foo }
This sort of smells, but it wouldn't if there were a new keyword to represent the way Proc.new behaves... then everyone would flex their Ruby muscles by writing confusing hacks that utilized the behavior of StrongReturnProc.new ... :)
Re:My Mixed Feelings about Ruby by raganwald on Monday June 30, 2008 @03:34PM (#232341)
it wouldn't if there were a new keyword to represent the way Proc.new behaves

My understanding is that there is a very good chance that Ruby 1.9 (when it stabilizes) will change the proc keyword to have Proc.new semantics instead of lambda semantics, for exactly the reason your give.