Open kojix2 opened 5 years ago
looking into this
Thank you for your work. @him666
But what I suggested was to change the behavior of the map
method.
Currently, the map
method returns an Array
, but I suggested changing it to return Daru::Vector
.
This is not a technical issue but a user consensus issue.
map_to_vector
is similar to recode
.
So I don't think we need a new method.
I too, think that map on Daru::Vector should return Daru::Vector and not Array.
Daru's vector returns an array when you call the
map
method.map
returns an array when you include module Enumerable. But, there is no rule that the map method must return an array in Ruby. For example,In Daru,
recode
return a Vector.This practice is not so common. I think map should return Daru :: Vector.
If there is room to change the API from now, please consider.