You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the polyglot docs, foreign objects understand size, which is an alias for length. In fact, foreign arrays should appear as Ruby Arrays and hence should also understand all other messages of Array. That would significantly improve portability of foreign code and it would be in line with what @chumer told me.
The text was updated successfully, but these errors were encountered:
Agreed, this would make sense but will probably be quite some effort to make it work, especially considering Array.public_instance_methods(false).size # => 104 and quite a few of these currently work on the internal Array representation directly.
Maybe we need a separate implementation of these methods for foreign arrays, which only support the array elements interop.
According to the polyglot docs, foreign objects understand
size
, which is an alias forlength
. In fact, foreign arrays should appear as RubyArray
s and hence should also understand all other messages ofArray
. That would significantly improve portability of foreign code and it would be in line with what @chumer told me.The text was updated successfully, but these errors were encountered: