repo.or.cz
/
rbx.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
Temporary tag for this failure. Updated CI spec coming.
[rbx.git]
/
kernel
/
bootstrap
/
symbol.rb
blob
36ebedb9e669aa41351ea8baff556290c5abfc4d
1
class SymbolTable
2
ivar_as_index :symbols => 1
3
4
def symbol_to_string(sym)
5
@symbols.at(sym.index)
6
end
7
end
8
9
class Symbol
10
def index
11
Ruby.primitive :symbol_index
12
raise PrimitiveFailure, "Symbol#index failed."
13
end
14
15
def to_s
16
Symbols.symbol_to_string(self)
17
end
18
19
def to_sym
20
self
21
end
22
end