Sha256: 63a7644008528c352b11a80ce51fc06392bdad2240d0571750a58b4f0bec4870
Contents?: true
Size: 544 Bytes
Versions: 4
Compression:
Stored size: 544 Bytes
Contents
module Kl module Primitives module Vectors def absvector(n) Kl::Absvector.new(n) end define_method 'address->' do |v, n, value| if n < 0 || n >= v.upper_limit raise Kl::Error, "out of bounds" end v[n] = value v end define_method '<-address' do |v, n| if n < 0 || n >= v.upper_limit raise Kl::Error, "out of bounds" end v[n] end def absvector?(v) v.kind_of? Kl::Absvector end end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
shen-ruby-0.3.1 | lib/kl/primitives/vectors.rb |
shen-ruby-0.3.0 | lib/kl/primitives/vectors.rb |
shen-ruby-0.2.0 | lib/kl/primitives/vectors.rb |
shen-ruby-0.1.0 | lib/kl/primitives/vectors.rb |