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

Change #dv to #to_dv? #131

Closed
lokeshh opened this issue May 20, 2016 · 3 comments
Closed

Change #dv to #to_dv? #131

lokeshh opened this issue May 20, 2016 · 3 comments

Comments

@lokeshh
Copy link
Member

lokeshh commented May 20, 2016

Array or ranges can be initialized to Daru::Vector with dv method like

[15] pry(main)> (1..3).dv
=> 
#<Daru::Vector:22990900 @name = nil @metadata = {} @size = 3 >
    nil
  0   1
  1   2
  2   3

I think to_dv is better because its intuitive and easy to remember similar to to_i, to_a, etc.

@zverok
Copy link
Collaborator

zverok commented May 20, 2016

+1 to this proposition.
Also, I'm not sure it is a good practice to pollute Ruby objects with such a short names.
I'd prefer having Array#to_daru_vector by default, and to_dv shortcut defined in something like daru/shortcuts (not required by default).

@v0dro
Copy link
Member

v0dro commented May 20, 2016

Ok works. to_daru_vector is better and more suited for a Ruby class change.

Also I like the daru/shortcuts idea.

@zverok
Copy link
Collaborator

zverok commented Oct 8, 2017

Closing in favor if #424

@zverok zverok closed this as completed Oct 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants