-
Notifications
You must be signed in to change notification settings - Fork 28
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
to_na instance method #32
Comments
|
Perhaps you misunderstood me. I'm not proposing we touch Array class. My proposal is we modify NArray class so that it behaves like Array when it is subclassed, by adding a to_na instance method to NArray. I want to be able to do this with NArray:
|
OK, now perhaps I understand.
Diff patch: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After subclassing NArray, I have discovered that NArray is missing a similar feature compared to Ruby's Array where you easily convert back to an Array.
With Array I can do this:
I propose we add a to_na instance method to NArray, similar as the to_a instance method for Array. The documentation for Ruby's to_a method says:
We can then do:
Is this possible?
The text was updated successfully, but these errors were encountered: