Skip to content

Commit

Permalink
Move 'at' and 'put' primitives to 'object_at' and 'object_put'.
Browse files Browse the repository at this point in the history
  • Loading branch information
drbrain committed Aug 4, 2008
1 parent 9e815fe commit a732f0e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
6 changes: 3 additions & 3 deletions kernel/bootstrap/class.rb
Expand Up @@ -54,12 +54,12 @@ class RuntimePrimitive
ByteCodes = 4

def put(idx, val)
Ruby.primitive :put
raise InvalidIndexError, "Object#put failed."
Ruby.primitive :object_put
raise InvalidIndexError, "RuntimePrimitive#put failed."
end

def at(idx)
Ruby.primitive :at
Ruby.primitive :object_at
raise InvalidIndexError, "RuntimePrimitive#at failed."
end

Expand Down
10 changes: 5 additions & 5 deletions kernel/bootstrap/tuple.rb
Expand Up @@ -16,22 +16,22 @@ def shifted(distance)
end

def [](idx)
Ruby.primitive :at
Ruby.primitive :object_at
raise InvalidIndexError, "Unable to access index '#{idx}' of #{self}"
end

def []=(idx, val)
Ruby.primitive :put
Ruby.primitive :object_put
raise InvalidIndexError, "Unable to set index '#{idx}' of #{self}"
end

def at(idx)
Ruby.primitive :at
raise InvalidIndexError, "Object#at failed."
Ruby.primitive :object_at
raise InvalidIndexError, "Tuple#at failed."
end

def put(idx, val)
Ruby.primitive :put
Ruby.primitive :object_put
raise InvalidIndexError, "Unable to set index '#{idx}' of #{self}"
end

Expand Down
Binary file modified runtime/stable/bootstrap.rba
Binary file not shown.
Binary file modified runtime/stable/compiler.rba
Binary file not shown.
9 changes: 4 additions & 5 deletions shotgun/lib/primitives.rb
Expand Up @@ -438,9 +438,8 @@ def fixnum_ge
CODE
end


defprim :at
def at
defprim :object_at
def object_at
<<-CODE
ARITY(1);
OBJECT t1;
Expand All @@ -456,8 +455,8 @@ def at
CODE
end

defprim :put
def put
defprim :object_put
def object_put
<<-CODE
ARITY(2);
OBJECT t1, t2;
Expand Down

0 comments on commit a732f0e

Please sign in to comment.