about summary refs log tree commit diff stats
path: root/045closure_name.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2017-11-01 02:46:41 -0700
committerKartik K. Agaram <vc@akkartik.com>2017-11-01 02:46:41 -0700
commitaae198a93b03ca53a0eb2a661c0a8cc47780573f (patch)
tree77d8365b53ec06ba8b410dd0b3661c19c82eb745 /045closure_name.cc
parentaa68aeb34e2476af8bfea8ba11e08e3d5f1d19f1 (diff)
downloadmu-aae198a93b03ca53a0eb2a661c0a8cc47780573f.tar.gz
4099
Generalize commit 4089 to arbitrary closures, and not just the current
'space' or call frame. Now we should be treating spaces just like any
other data structure, and reclaiming all addresses inside them when we
need to.

The cost: all spaces must now specify what recipe generated them (so
they know how to interpret the array of locations) using the /names
property.

We can probably make this ergonomic with a little 'type inference'. But
at least things are safe now.
Diffstat (limited to '045closure_name.cc')
-rw-r--r--045closure_name.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/045closure_name.cc b/045closure_name.cc
index f7c0082f..0f67e2d2 100644
--- a/045closure_name.cc
+++ b/045closure_name.cc
@@ -47,7 +47,7 @@ void collect_surrounding_spaces(const recipe_ordinal r) {
     for (int j = 0;  j < SIZE(inst.products);  ++j) {
       if (is_literal(inst.products.at(j))) continue;
       if (inst.products.at(j).name != "0") continue;
-      if (!is_space(inst.products.at(j))) {
+      if (!is_mu_space(inst.products.at(j))) {
         raise << "slot 0 should always have type address:array:location, but is '" << to_string(inst.products.at(j)) << "'\n" << end();
         continue;
       }
@@ -159,7 +159,7 @@ def new-scope [
 ]
 def use-scope [
   local-scope
-  outer:space <- next-ingredient
+  outer:space/names:new-scope <- next-ingredient
   0:space/names:new-scope <- copy outer:space
   return *x:&:num/space:1
 ]