lib/kl/primitives/vectors.rb in shen-ruby-0.4.1 vs lib/kl/primitives/vectors.rb in shen-ruby-0.5.0
- old
+ new
@@ -1,9 +1,10 @@
module Kl
module Primitives
module Vectors
def absvector(n)
raise Kl::Error, "#{n} is not a number" unless n.kind_of? Fixnum
+ raise Kl::Error, "#{n} must be >= 0" unless n >= 0
Kl::Absvector.new(n)
end
define_method 'address->' do |v, n, value|
raise Kl::Error, "#{v} is not a vector" unless v.kind_of? Kl::Absvector