News for hackers. Stuff that matters.
Re:Ruby 2.6 by mikekchar on Monday December 24, 2018 @06:33PM (#18754885)
I'm not so sure about the block thing. I mean I like having first class function-like objects, but you've got blocks and procs and both of these are different from bound and unbound methods. I would prefer that there was a single function type, personally. I wonder if I'm missing something, though. Is there an advantage to distinction between blocks and procs that ruby makes?
Re:Ruby 2.6 by ravenstine on Monday December 24, 2018 @09:16PM (#18755456)
A block is a proc.

```ruby

def foo &bar

  return bar
end

foo {}

# => #<Proc:0x00007ff23783c4e0@(irb):16>

```

But I do agree that I don't quite understand the need for the distinction between procs and methods, or the need for unbound methods; I would think that methods could just be either bound to one object or another, as unbound methods are useless for the fact that they won't work at all unless they are bound.

Re:Ruby 2.6 by int_19h on Tuesday December 25, 2018 @06:06AM (#18756967)
I think they rather meant the difference between procs and lambdas (e.g. wrt return).