diff options
author | olpc user <olpc@xo-5d-f7-86.localdomain> | 2019-11-25 05:02:10 -0800 |
---|---|---|
committer | olpc user <olpc@xo-5d-f7-86.localdomain> | 2019-11-25 05:02:10 -0800 |
commit | 520119a6f6ed418b8ae45bfde8239bbb532562cd (patch) | |
tree | 6cc381877adb5ddfaf131415c64f87eca5649676 /starts/meaning-vm/level-0/ref.cpp | |
parent | cd03e291664cb102bde61d86a15f0add11809766 (diff) | |
download | standingwithresilience-520119a6f6ed418b8ae45bfde8239bbb532562cd.tar.gz standingwithresilience-520119a6f6ed418b8ae45bfde8239bbb532562cd.zip |
cleanup mixin pointer mess for refs
Diffstat (limited to 'starts/meaning-vm/level-0/ref.cpp')
-rw-r--r-- | starts/meaning-vm/level-0/ref.cpp | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/starts/meaning-vm/level-0/ref.cpp b/starts/meaning-vm/level-0/ref.cpp index f468456..d4758bd 100644 --- a/starts/meaning-vm/level-0/ref.cpp +++ b/starts/meaning-vm/level-0/ref.cpp @@ -6,25 +6,17 @@ using namespace intellect::level0; -ref::ref(concept *p) -: ptr(p) -{ - if (p == 0) { - throw null_reference(); - } -} - std::string ref::dump(ref skipmarkertype, ref skipmarkertarget) { - if (self->linked(skipmarkertype, skipmarkertarget)) { + if (self.linked(skipmarkertype, skipmarkertarget)) { return {}; } - std::string ret = std::to_string((unsigned long)ptr) + ":\n"; - for (auto & link : self->links) { - ret += " " + std::to_string((unsigned long)link.first.ptr) + ": " + std::to_string((unsigned long)link.second.ptr) + "\n"; + std::string ret = std::to_string((unsigned long)ptr()) + ":\n"; + for (auto & link : self.links()) { + ret += " " + std::to_string((unsigned long)link.first.ptr()) + ": " + std::to_string((unsigned long)link.second.ptr()) + "\n"; } - self->link(skipmarkertype, skipmarkertarget); - for (auto & link : self->links) { + self.link(skipmarkertype, skipmarkertarget); + for (auto & link : self.links()) { if (link.first == skipmarkertype && link.second == skipmarkertarget) { continue; } |