From 4690ce81e079fc58cae8d6d583e5e3eb3ed81a83 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Wed, 9 Mar 2016 02:56:27 -0800 Subject: 2743 Looks like "TOhtml | " doesn't work on Mac OS X for some reason.. --- html/044space_surround.cc.html | 56 ++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 32 deletions(-) (limited to 'html/044space_surround.cc.html') diff --git a/html/044space_surround.cc.html b/html/044space_surround.cc.html index 0baf4873..7f1a4723 100644 --- a/html/044space_surround.cc.html +++ b/html/044space_surround.cc.html @@ -3,34 +3,27 @@ Mu - 044space_surround.cc - - + + - - + - - -
+
 //: So far you can have global variables by not setting default-space, and
 //: local variables by setting default-space. You can isolate variables
 //: between those extremes by creating 'surrounding' spaces.
@@ -39,7 +32,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
 
 :(scenario surrounding_space)
 # location 1 in space 1 refers to the space surrounding the default space, here 20.
-recipe main [
+def main [
   # pretend shared:array:location; in practice we'll use new
   10:number <- copy 0  # refcount
   11:number <- copy 5  # length
@@ -47,12 +40,12 @@ recipe main [
   20:number <- copy 0  # refcount
   21:number <- copy 5  # length
   # actual start of this recipe
-  default-space:address:shared:array:location <- copy 10/unsafe
+  default-space:address:shared:array:location <- copy 10/unsafe
   0:address:shared:array:location/names:dummy <- copy 20/unsafe  # later layers will explain the /names: property
   1:number <- copy 32
   1:number/space:1 <- copy 33
 ]
-recipe dummy [  # just for the /names: property above
+def dummy [  # just for the /names: property above
 ]
 # chain space: 10 + /*skip refcount*/1 + /*skip length*/1
 +mem: storing 20 in location 12
@@ -66,23 +59,23 @@ recipe dummy [  # just for the /names: property above//: one.
 
 :(replace{} "long long int space_base(const reagent& x)")
-long long int space_base(const reagent& x) {
-  long long int base = current_call().default_space ? (current_call().default_space+/*skip refcount*/1) : 0;
+long long int space_base(const reagent& x) {
+  long long int base = current_call().default_space ? (current_call().default_space+/*skip refcount*/1) : 0;
   return space_base(x, space_index(x), base);
 }
 
-long long int space_base(const reagent& x, long long int space_index, long long int base) {
-  if (space_index == 0)
+long long int space_base(const reagent& x, long long int space_index, long long int base) {
+  if (space_index == 0)
     return base;
-  long long int result = space_base(x, space_index-1, get_or_insert(Memory, base+/*skip length*/1))+/*skip refcount*/1;
+  long long int result = space_base(x, space_index-1, get_or_insert(Memory, base+/*skip length*/1))+/*skip refcount*/1;
   return result;
 }
 
-long long int space_index(const reagent& x) {
-  for (long long int i = 0; i < SIZE(x.properties); ++i) {
-    if (x.properties.at(i).first == "space") {
-      if (!x.properties.at(i).second || x.properties.at(i).second->right)
-        raise_error << maybe(current_recipe_name()) << "/space metadata should take exactly one value in " << x.original_string << '\n' << end();
+long long int space_index(const reagent& x) {
+  for (long long int i = 0; i < SIZE(x.properties); ++i) {
+    if (x.properties.at(i).first == "space") {
+      if (!x.properties.at(i).second || x.properties.at(i).second->right)
+        raise << maybe(current_recipe_name()) << "/space metadata should take exactly one value in " << x.original_string << '\n' << end();
       return to_integer(x.properties.at(i).second->value);
     }
   }
@@ -90,10 +83,9 @@ long long int space_index(const reagent& x}
 
 :(scenario permit_space_as_variable_name)
-recipe main [
+def main [
   space:number <- copy 0
 ]
 
- -- cgit 1.4.1-2-gfad0