Revert "fixed bug in lib/thread Queue"
[rbx.git] / kernel / bootstrap / tuple.rb
blob87c227b095b98df0823febef4ddaa99f27dd54d7
1 class Tuple
3   def self.new(cnt)
4     Ruby.primitive :allocate_count
5     raise PrimitiveFailure, "primitive failed"
6   end
8   def self.template(size, obj)
9     Ruby.primitive :tuple_template
10     raise PrimitiveFailure, "Tuple.template primitive failed"
11   end
13   def shifted(distance)
14     Ruby.primitive :tuple_shifted
15     raise PrimitiveFailure, "primitive failed"
16   end
18   def [](idx)
19     Ruby.primitive :at
20     raise InvalidIndexError, "Unable to access index '#{idx}' of #{self}"
21   end
23   def []=(idx, val)
24     Ruby.primitive :put
25     raise InvalidIndexError, "Unable to set index '#{idx}' of #{self}"
26   end
28   def at(idx)
29     Ruby.primitive :at
30     raise InvalidIndexError, "Object#at failed."
31   end
33   def put(idx, val)
34     Ruby.primitive :put
35     raise InvalidIndexError, "Unable to set index '#{idx}' of #{self}"
36   end
38   def fields
39     Ruby.primitive :fields
40     raise PrimitiveFailure, "primitive failed"
41   end
43 end