[Ironruby-core] Referencing a CLR List in IronRuby

Eric Nicholson enicholson at gmail.com
Thu Oct 11 15:31:13 EDT 2007


I can't figure out how to get items out of any of the CLR List types in
IronRuby.  Here's a contrived example:

>>> require 'mscorlib'
=> true
>>> foo = System::Collections::ArrayList.new()
=> #<ArrayList:0x0000056>
>>> foo.Item(0)
System.MissingMethodException: undefined local variable or method `Item' for
#<ArrayList:0x0000056>:ArrayList

Here's the only thing I could think of that does work:
>>> foo.ToArray.GetValue(0)
=> "Hello"

Does anyone know why that is?  Or maybe a better work-around?

Thanks!

-Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20071011/517c213d/attachment.html 


More information about the Ironruby-core mailing list