been makin a little “Vector” class by extending Array.
Now I wanna add Vector support to the native numeric
data types in ruby. Means: Not only Vector+Numeric
but also Numeric+Vector should call my + function.
But I have a syntax prolem…
Example (not working!):
class Fixnum
alias old+ + # here i have the syntax problem
def +(other)
if (other.class<=Vector)
other+self
else
self.old+(other)
end
end
end
realise it was yet another one…
If you’re not doing it for the fun of it: there are already vector and
matrix classes for Ruby plus libraries for manipulating them like
narray (see the RAA).
If you’re not doing it for the fun of it: there are already vector and
matrix classes for Ruby plus libraries for manipulating them like
narray (see the RAA).
I have seen and downloaded narray.
I don’t use it because it is usually more hassle to
get stuff like that running and learn how to use it
and then find out that it is not quite what you’ve
been looking for after all than just DIY…
I am sitting here in a Hotel room with a newbought,
virgin Windoze notebook. I don’t even want to try
to estimate how long it will take me to get the
compiler, utilities and whatnot up and running to
even start to compile narray.
But if I can get no-hassle installable binaries
somewhere, I’ll be happy to give it a chance.
Perhaps a parallel for ActiveState’s PPM (pre compiled modules) would be
nice. Unfortunately, Ruby still has no ActiveState version. Anyone knows
about plans to make it ?
I am sitting here in a Hotel room with a newbought,
virgin Windoze notebook. I don’t even want to try
to estimate how long it will take me to get the
compiler, utilities and whatnot up and running to
even start to compile narray.
But if I can get no-hassle installable binaries
somewhere, I’ll be happy to give it a chance.
Regards, Frank
Ah… the reason that made my avoid so many Perl modules in my time… I
guess it’s the same for Ruby. Perhaps it should be made a custom that
every extension library has a pure-Ruby version. This is useful for
prototyping - if one sees that the library fits his needs, he can later
put in the effort to actually compile and bind the extension to his
Ruby.
Perhaps a parallel for ActiveState’s PPM (pre compiled modules) would be
nice. Unfortunately, Ruby still has no ActiveState version. Anyone knows
about plans to make it ?
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.