News for hackers. Stuff that matters.
Re:Ruby 3.3 by dragonwriter on Tuesday December 26, 2023 @03:23AM (#38769860)
No, blocks are not first class (procs are, and procs are the closest thing Ruby has to functions, and a method definition can bind convert the block passed to the function to a proc if a first-class value is needed.)

Blocks are a syntactically special single argument to a method that can either be yielded to (a Ruby construct similar to a function call but which only applies to the block passed to the current method) or converted to a proc (but the latter only as part of the method definition, since they aren't first class and thus cannot be manipulated or referred to directly.)

There are no comments on this comment yet.