Optimization of string and vector with references and less functional code, bugfix of closing over references

This commit is contained in:
Nathan Braswell
2015-08-04 14:57:56 -04:00
parent d59cb5e252
commit e1dbe08c0a
8 changed files with 67 additions and 42 deletions

View File

@@ -54,14 +54,14 @@ obj symbol (Object) {
name.copy_construct(&old->name)
terminal = old->terminal
}
fun operator=(old: symbol) {
fun operator=(old: ref symbol) {
destruct()
copy_construct(&old)
}
fun operator==(other: symbol): bool {
fun operator==(other: ref symbol): bool {
return data == other.data && name == other.name && terminal == other.terminal;
}
fun operator!=(other: symbol): bool {
fun operator!=(other: ref symbol): bool {
return !(*this == other);
}
fun to_string(): string::string {