jschementi / iron

[Jimmy Schementi's development fork] Implementations of Python and Ruby programming languages for .NET Framework that are built on top of the Dynamic Language Runtime.
http://ironruby.net
17 stars 2 forks source link

Possibly enumerating RubyArray #22

Closed jschementi closed 15 years ago

jschementi commented 15 years ago

These might also be better to write in C# if ruby_response[2] is some strongly typed object (RubyArray?). If it is not then enumerating it from C# gets a little bit tricky (we don’t provide any easy to use helper for that, we probably should), so for now evaluating the code is reasonable.

RubyEngine.Execute("__body.each { |part| __response.write part }", handle_scope);
RubyEngine.Execute("__body.close if __body.respond_to? :close", handle_scope);
jschementi commented 15 years ago

No, ruby_response[2](the body of the response) only must respond to "each" and yield Strings. It would be cool to write that first line maybe something like this:

ruby_response[2].Send("each", (part) => response.Write(part))
jschementi commented 15 years ago

Closing bug, but should think about adding an implicit delegate to IronRuby