rubyx/lib/soml/parfait/word.soml
2015-11-19 10:09:24 +02:00

30 lines
525 B
Plaintext

class Word < Object
int correct_index(int index)
return index + 8
end
int char_at(int index)
index = correct_index(index)
return get_internal_byte(index)
end
int set_length(int i)
set_internal_word( 2 , i)
return i
end
int set_char_at( int index , int val)
index = correct_index(index)
return set_internal_byte(index , val)
end
Word push_char(int char)
int index = self.char_length + 1
self.set_length(index)
set_char_at(index , char)
return self
end
end