about summary refs log tree commit diff stats
path: root/cpp/027space
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-03-28 20:57:21 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-03-28 20:57:21 -0700
commit8f1db754005616054192b3f75e54af9929df26cc (patch)
tree9cef43e2279326f28c028c126349d929e345b8f5 /cpp/027space
parent75845d2b1276214ce6c3cbc3504e49cb946d29f0 (diff)
downloadmu-8f1db754005616054192b3f75e54af9929df26cc.tar.gz
992 - c++ chain spaces for lexical scope
Diffstat (limited to 'cpp/027space')
-rw-r--r--cpp/027space6
1 files changed, 5 insertions, 1 deletions
diff --git a/cpp/027space b/cpp/027space
index 2fa6f36d..0e1686f0 100644
--- a/cpp/027space
+++ b/cpp/027space
@@ -26,7 +26,7 @@ reagent absolutize(reagent x) {
 //?   cout << "not raw: " << x.to_string() << '\n'; //? 1
   assert(x.initialized);
   reagent r = x;
-  r.set_value(address(r.value, Current_routine.calls.top().default_space));
+  r.set_value(address(r.value, space(r)));
 //?   cout << "after absolutize: " << r.value << '\n'; //? 1
   if (r.properties.empty())
     r.properties.push_back(pair<string, vector<string> >("", vector<string>()));
@@ -35,6 +35,10 @@ reagent absolutize(reagent x) {
   return r;
 }
 
+int space(const reagent& x) {
+  return Current_routine.calls.top().default_space;
+}
+
 int address(int offset, int base) {
   if (base == 0) return offset;  // raw
   return base+offset+1;