Just an observation (and I'm waiting for six people to quote previous
ruby-talk articles to show they'd thought of this first):
When we get keyword arguments, a slight extension to the syntax will
also allow us to pass multiple blocks to a method:
def polar_plot(x, y)
0...n times do |i|
angle = i*TWO_PI/n
x_pos = x.call(angle)
y_pos = y.call(angle)
drawTo(x, y)
end
end
polar_plot x: { |i| sin(i) } y: {|i| i*i }
(Borrowing a leaf from Smalltalk's book)
Dave