diff options
author | olpc user <olpc@xo-5d-f7-86.localdomain> | 2019-11-23 09:11:28 -0800 |
---|---|---|
committer | olpc user <olpc@xo-5d-f7-86.localdomain> | 2019-11-23 09:11:28 -0800 |
commit | fed2ac694bd028d119581ea05a3376e791aee97d (patch) | |
tree | 726785b677c3109a16a9b0b1b27ade16b2cfea51 /starts/meaning-vm/concept.cpp | |
parent | c0fdff872ca2c48939bacfefce020878ef92b44c (diff) | |
download | standingwithresilience-fed2ac694bd028d119581ea05a3376e791aee97d.tar.gz standingwithresilience-fed2ac694bd028d119581ea05a3376e791aee97d.zip |
more syntax sugar, building meaning
Diffstat (limited to 'starts/meaning-vm/concept.cpp')
-rw-r--r-- | starts/meaning-vm/concept.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/starts/meaning-vm/concept.cpp b/starts/meaning-vm/concept.cpp index c064ed4..03c784f 100644 --- a/starts/meaning-vm/concept.cpp +++ b/starts/meaning-vm/concept.cpp @@ -20,11 +20,16 @@ bool concept::linked(ref type, ref target) return false; } -ref concept::get(ref type) +ref concept::get(ref type, bool quick) { + // this is called by name(), so it passes quick=true auto result = links.equal_range(type.ptr); if (result.first == result.second) { - throw std::out_of_range("no such concept link to get: " + type.name()); + if (quick) { + throw std::out_of_range("no such concept link to get"); + } else { + throw std::out_of_range("no such concept link to get: " + type.name()); + } } return result.first->second; } |