Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[interop] Array-like object do not implement length and other Array methods #1844

Closed
fniephaus opened this issue Dec 2, 2019 · 2 comments
Closed
Assignees
Labels
Milestone

Comments

@fniephaus
Copy link
Member

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.

@eregon eregon added the polyglot label Dec 2, 2019
@eregon
Copy link
Member

eregon commented Dec 2, 2019

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.

@pitr-ch pitr-ch self-assigned this Dec 16, 2019
@eregon eregon self-assigned this Sep 6, 2021
@eregon eregon added this to the 21.3.0 milestone Sep 6, 2021
@eregon
Copy link
Member

eregon commented Sep 6, 2021

This is done now (#2149 (comment)).

@eregon eregon closed this as completed Sep 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants