E
Elias Athanasopoulos
Hello!
Well, just a thought... Consider that:
1000.times do |a, b, c|
a = ...
b = ...
c = ...
bar a
bar b
bar c
foo
end
Okay, this is a bad design, but let's say that I can't change
it. Can a Ruby syntax structure like the one below constructed
in an (almost) easy way?
via bar foo do |a, b, c|
a = ...
b = ...
c = ...
end
i.e. can I construct in pure Ruby or via a C extension a 'via'
method for Object, which will enhance:
foo do { |...| ... }
in a way, that all block arguments will be passed in another
method before the end of the block?
If all these do not make sense, just forgive me. It's night
here.
Regards,
Well, just a thought... Consider that:
1000.times do |a, b, c|
a = ...
b = ...
c = ...
bar a
bar b
bar c
foo
end
Okay, this is a bad design, but let's say that I can't change
it. Can a Ruby syntax structure like the one below constructed
in an (almost) easy way?
via bar foo do |a, b, c|
a = ...
b = ...
c = ...
end
i.e. can I construct in pure Ruby or via a C extension a 'via'
method for Object, which will enhance:
foo do { |...| ... }
in a way, that all block arguments will be passed in another
method before the end of the block?
If all these do not make sense, just forgive me. It's night
here.
Regards,