John Joyce
8/18/2007 2:45:00 AM
On Aug 17, 2007, at 5:00 PM, Phlip wrote:
> Robert Klemme wrote:
>
>> CPU8086 do
>> label :begin
>> push 42
>> shift :b
>> jmp :begin
>> end
>
> How you get a class name to respond to do? I thought objects couldn't
> respond to do, essentially at the syntax level...
>
> (Or is that pseudo?)
>
Nah, it's just a normal block of Ruby!
With an iterator, you might do:
10.times do
puts 'hello'
end
In this case, 10 is not really any different than CPU8086.
Think of do-end as a block that iterates 1 time. That's what it is!