diff options
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/.traces/buffer-append-works | 2 | ||||
-rw-r--r-- | cpp/.traces/closure | 16 | ||||
-rw-r--r-- | cpp/.traces/deref_sidesteps_default_space | 2 | ||||
-rw-r--r-- | cpp/.traces/deref_sidesteps_default_space_in_get | 2 | ||||
-rw-r--r-- | cpp/.traces/deref_sidesteps_default_space_in_index | 2 | ||||
-rw-r--r-- | cpp/.traces/get_default_space | 4 | ||||
-rw-r--r-- | cpp/.traces/set_default_space | 2 | ||||
-rw-r--r-- | cpp/.traces/string-equal-common-lengths-but-distinct | 2 | ||||
-rw-r--r-- | cpp/.traces/string-equal-distinct-lengths | 2 | ||||
-rw-r--r-- | cpp/.traces/string-equal-identical | 2 | ||||
-rw-r--r-- | cpp/.traces/string-equal-reflexive | 2 | ||||
-rw-r--r-- | cpp/.traces/string-equal-with-empty | 2 | ||||
-rw-r--r-- | cpp/.traces/surrounding_space | 4 | ||||
-rw-r--r-- | cpp/043space | 12 | ||||
-rw-r--r-- | cpp/044space_surround | 4 | ||||
-rw-r--r-- | cpp/054closure_name | 25 | ||||
-rw-r--r-- | cpp/060string.mu | 28 |
17 files changed, 57 insertions, 56 deletions
diff --git a/cpp/.traces/buffer-append-works b/cpp/.traces/buffer-append-works index c5a3e121..bef17f83 100644 --- a/cpp/.traces/buffer-append-works +++ b/cpp/.traces/buffer-append-works @@ -1,7 +1,7 @@ parse/0: instruction: 33 parse/0: ingredient: {name: "location", value: 0, type: 0, properties: ["location": "type"]} parse/0: ingredient: {name: "30", value: 0, type: 0, properties: ["30": "literal"]} -parse/0: product: {name: "default-space", value: 0, type: 2-0, properties: ["default-space": "address":"space"]} +parse/0: product: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} parse/0: instruction: 101 parse/0: ingredient: {name: "3", value: 0, type: 0, properties: ["3": "literal"]} parse/0: product: {name: "x", value: 0, type: 2-9, properties: ["x": "address":"buffer"]} diff --git a/cpp/.traces/closure b/cpp/.traces/closure index 2733df16..4a6fc50b 100644 --- a/cpp/.traces/closure +++ b/cpp/.traces/closure @@ -1,19 +1,19 @@ parse/0: instruction: 33 parse/0: ingredient: {name: "location", value: 0, type: 0, properties: ["location": "type"]} parse/0: ingredient: {name: "30", value: 0, type: 0, properties: ["30": "literal"]} -parse/0: product: {name: "default-space", value: 0, type: 2-0, properties: ["default-space": "address":"space"]} +parse/0: product: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} parse/0: instruction: 1001 -parse/0: product: {name: "1", value: 0, type: 2-0, properties: ["1": "address":"space", "names": "init-counter"]} +parse/0: product: {name: "1", value: 0, type: 2-5-1, properties: ["1": "address":"array":"location", "names": "init-counter"]} parse/0: instruction: 1002 -parse/0: ingredient: {name: "1", value: 0, type: 2-0, properties: ["1": "address":"space", "names": "init-counter"]} +parse/0: ingredient: {name: "1", value: 0, type: 2-5-1, properties: ["1": "address":"array":"location", "names": "init-counter"]} parse/0: product: {name: "2", value: 0, type: 1, properties: ["2": "integer", "raw": ]} parse/0: instruction: 1002 -parse/0: ingredient: {name: "1", value: 0, type: 2-0, properties: ["1": "address":"space", "names": "init-counter"]} +parse/0: ingredient: {name: "1", value: 0, type: 2-5-1, properties: ["1": "address":"array":"location", "names": "init-counter"]} parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer", "raw": ]} parse/0: instruction: 33 parse/0: ingredient: {name: "location", value: 0, type: 0, properties: ["location": "type"]} parse/0: ingredient: {name: "30", value: 0, type: 0, properties: ["30": "literal"]} -parse/0: product: {name: "default-space", value: 0, type: 2-0, properties: ["default-space": "address":"space"]} +parse/0: product: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} parse/0: instruction: 1 parse/0: ingredient: {name: "23", value: 0, type: 0, properties: ["23": "literal"]} parse/0: product: {name: "x", value: 0, type: 1, properties: ["x": "integer"]} @@ -21,13 +21,13 @@ parse/0: instruction: 1 parse/0: ingredient: {name: "3", value: 0, type: 0, properties: ["3": "literal"]} parse/0: product: {name: "y", value: 0, type: 1, properties: ["y": "integer"]} parse/0: instruction: 26 -parse/0: ingredient: {name: "default-space", value: 0, type: 2-0, properties: ["default-space": "address":"space"]} +parse/0: ingredient: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} parse/0: instruction: 33 parse/0: ingredient: {name: "space", value: 0, type: 0, properties: ["space": "literal"]} parse/0: ingredient: {name: "30", value: 0, type: 0, properties: ["30": "literal"]} -parse/0: product: {name: "default-space", value: 0, type: 2-0, properties: ["default-space": "address":"space"]} +parse/0: product: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} parse/0: instruction: 25 -parse/0: product: {name: "0", value: 0, type: 2-0, properties: ["0": "address":"space", "names": "init-counter"]} +parse/0: product: {name: "0", value: 0, type: 2-5-1, properties: ["0": "address":"array":"location", "names": "init-counter"]} parse/0: instruction: 2 parse/0: ingredient: {name: "y", value: 0, type: 1, properties: ["y": "integer", "space": "1"]} parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "literal"]} diff --git a/cpp/.traces/deref_sidesteps_default_space b/cpp/.traces/deref_sidesteps_default_space index 0fd3d790..649911a1 100644 --- a/cpp/.traces/deref_sidesteps_default_space +++ b/cpp/.traces/deref_sidesteps_default_space @@ -6,7 +6,7 @@ parse/0: ingredient: {name: "5", value: 0, type: 0, properties: ["5": "literal parse/0: product: {name: "1000", value: 0, type: 1, properties: ["1000": "integer"]} parse/0: instruction: 1 parse/0: ingredient: {name: "1000", value: 0, type: 0, properties: ["1000": "literal"]} -parse/0: product: {name: "default-space", value: 0, type: 2-0, properties: ["default-space": "address":"space"]} +parse/0: product: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} parse/0: instruction: 1 parse/0: ingredient: {name: "3", value: 0, type: 0, properties: ["3": "literal"]} parse/0: product: {name: "1", value: 0, type: 2-1, properties: ["1": "address":"integer"]} diff --git a/cpp/.traces/deref_sidesteps_default_space_in_get b/cpp/.traces/deref_sidesteps_default_space_in_get index e12e1500..b30aab53 100644 --- a/cpp/.traces/deref_sidesteps_default_space_in_get +++ b/cpp/.traces/deref_sidesteps_default_space_in_get @@ -9,7 +9,7 @@ parse/0: ingredient: {name: "5", value: 0, type: 0, properties: ["5": "literal parse/0: product: {name: "1000", value: 0, type: 1, properties: ["1000": "integer"]} parse/0: instruction: 1 parse/0: ingredient: {name: "1000", value: 0, type: 0, properties: ["1000": "literal"]} -parse/0: product: {name: "default-space", value: 0, type: 2-0, properties: ["default-space": "address":"space"]} +parse/0: product: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} parse/0: instruction: 1 parse/0: ingredient: {name: "12", value: 0, type: 0, properties: ["12": "literal"]} parse/0: product: {name: "1", value: 0, type: 2-6, properties: ["1": "address":"point"]} diff --git a/cpp/.traces/deref_sidesteps_default_space_in_index b/cpp/.traces/deref_sidesteps_default_space_in_index index 24c8ea0e..17477059 100644 --- a/cpp/.traces/deref_sidesteps_default_space_in_index +++ b/cpp/.traces/deref_sidesteps_default_space_in_index @@ -12,7 +12,7 @@ parse/0: ingredient: {name: "5", value: 0, type: 0, properties: ["5": "literal parse/0: product: {name: "1000", value: 0, type: 1, properties: ["1000": "integer"]} parse/0: instruction: 1 parse/0: ingredient: {name: "1000", value: 0, type: 0, properties: ["1000": "literal"]} -parse/0: product: {name: "default-space", value: 0, type: 2-0, properties: ["default-space": "address":"space"]} +parse/0: product: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} parse/0: instruction: 1 parse/0: ingredient: {name: "12", value: 0, type: 0, properties: ["12": "literal"]} parse/0: product: {name: "1", value: 0, type: 2-5-1, properties: ["1": "address":"array":"integer"]} diff --git a/cpp/.traces/get_default_space b/cpp/.traces/get_default_space index 1d521c90..7b76e379 100644 --- a/cpp/.traces/get_default_space +++ b/cpp/.traces/get_default_space @@ -1,8 +1,8 @@ parse/0: instruction: 1 parse/0: ingredient: {name: "10", value: 0, type: 0, properties: ["10": "literal"]} -parse/0: product: {name: "default-space", value: 0, type: 2-0, properties: ["default-space": "address":"space"]} +parse/0: product: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} parse/0: instruction: 1 -parse/0: ingredient: {name: "default-space", value: 0, type: 2-0, properties: ["default-space": "address":"space"]} +parse/0: ingredient: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer", "raw": ]} after-brace/0: recipe main after-brace/0: copy ... diff --git a/cpp/.traces/set_default_space b/cpp/.traces/set_default_space index 627719aa..d1369f9e 100644 --- a/cpp/.traces/set_default_space +++ b/cpp/.traces/set_default_space @@ -3,7 +3,7 @@ parse/0: ingredient: {name: "5", value: 0, type: 0, properties: ["5": "literal parse/0: product: {name: "10", value: 0, type: 1, properties: ["10": "integer"]} parse/0: instruction: 1 parse/0: ingredient: {name: "10", value: 0, type: 0, properties: ["10": "literal"]} -parse/0: product: {name: "default-space", value: 0, type: 2-0, properties: ["default-space": "address":"space"]} +parse/0: product: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} parse/0: instruction: 1 parse/0: ingredient: {name: "23", value: 0, type: 0, properties: ["23": "literal"]} parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} diff --git a/cpp/.traces/string-equal-common-lengths-but-distinct b/cpp/.traces/string-equal-common-lengths-but-distinct index 99c601b8..8cb6a307 100644 --- a/cpp/.traces/string-equal-common-lengths-but-distinct +++ b/cpp/.traces/string-equal-common-lengths-but-distinct @@ -1,7 +1,7 @@ parse/0: instruction: 33 parse/0: ingredient: {name: "location", value: 0, type: 0, properties: ["location": "type"]} parse/0: ingredient: {name: "30", value: 0, type: 0, properties: ["30": "literal"]} -parse/0: product: {name: "default-space", value: 0, type: 2-0, properties: ["default-space": "address":"space"]} +parse/0: product: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} parse/0: instruction: 33 parse/0: ingredient: {name: "abc", value: 0, type: 0, properties: ["abc": "literal-string"]} parse/0: product: {name: "x", value: 0, type: 2-5-4, properties: ["x": "address":"array":"character"]} diff --git a/cpp/.traces/string-equal-distinct-lengths b/cpp/.traces/string-equal-distinct-lengths index 43e17736..62d0518b 100644 --- a/cpp/.traces/string-equal-distinct-lengths +++ b/cpp/.traces/string-equal-distinct-lengths @@ -1,7 +1,7 @@ parse/0: instruction: 33 parse/0: ingredient: {name: "location", value: 0, type: 0, properties: ["location": "type"]} parse/0: ingredient: {name: "30", value: 0, type: 0, properties: ["30": "literal"]} -parse/0: product: {name: "default-space", value: 0, type: 2-0, properties: ["default-space": "address":"space"]} +parse/0: product: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} parse/0: instruction: 33 parse/0: ingredient: {name: "abc", value: 0, type: 0, properties: ["abc": "literal-string"]} parse/0: product: {name: "x", value: 0, type: 2-5-4, properties: ["x": "address":"array":"character"]} diff --git a/cpp/.traces/string-equal-identical b/cpp/.traces/string-equal-identical index e1d8cd68..41e08402 100644 --- a/cpp/.traces/string-equal-identical +++ b/cpp/.traces/string-equal-identical @@ -1,7 +1,7 @@ parse/0: instruction: 33 parse/0: ingredient: {name: "location", value: 0, type: 0, properties: ["location": "type"]} parse/0: ingredient: {name: "30", value: 0, type: 0, properties: ["30": "literal"]} -parse/0: product: {name: "default-space", value: 0, type: 2-0, properties: ["default-space": "address":"space"]} +parse/0: product: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} parse/0: instruction: 33 parse/0: ingredient: {name: "abc", value: 0, type: 0, properties: ["abc": "literal-string"]} parse/0: product: {name: "x", value: 0, type: 2-5-4, properties: ["x": "address":"array":"character"]} diff --git a/cpp/.traces/string-equal-reflexive b/cpp/.traces/string-equal-reflexive index 40391159..c9de76a7 100644 --- a/cpp/.traces/string-equal-reflexive +++ b/cpp/.traces/string-equal-reflexive @@ -1,7 +1,7 @@ parse/0: instruction: 33 parse/0: ingredient: {name: "location", value: 0, type: 0, properties: ["location": "type"]} parse/0: ingredient: {name: "30", value: 0, type: 0, properties: ["30": "literal"]} -parse/0: product: {name: "default-space", value: 0, type: 2-0, properties: ["default-space": "address":"space"]} +parse/0: product: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} parse/0: instruction: 33 parse/0: ingredient: {name: "abc", value: 0, type: 0, properties: ["abc": "literal-string"]} parse/0: product: {name: "x", value: 0, type: 2-5-4, properties: ["x": "address":"array":"character"]} diff --git a/cpp/.traces/string-equal-with-empty b/cpp/.traces/string-equal-with-empty index fc943af0..56be4087 100644 --- a/cpp/.traces/string-equal-with-empty +++ b/cpp/.traces/string-equal-with-empty @@ -1,7 +1,7 @@ parse/0: instruction: 33 parse/0: ingredient: {name: "location", value: 0, type: 0, properties: ["location": "type"]} parse/0: ingredient: {name: "30", value: 0, type: 0, properties: ["30": "literal"]} -parse/0: product: {name: "default-space", value: 0, type: 2-0, properties: ["default-space": "address":"space"]} +parse/0: product: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} parse/0: instruction: 33 parse/0: ingredient: {name: "", value: 0, type: 0, properties: ["": "literal-string"]} parse/0: product: {name: "x", value: 0, type: 2-5-4, properties: ["x": "address":"array":"character"]} diff --git a/cpp/.traces/surrounding_space b/cpp/.traces/surrounding_space index f4bc55fe..3ff1b951 100644 --- a/cpp/.traces/surrounding_space +++ b/cpp/.traces/surrounding_space @@ -6,10 +6,10 @@ parse/0: ingredient: {name: "5", value: 0, type: 0, properties: ["5": "literal parse/0: product: {name: "20", value: 0, type: 1, properties: ["20": "integer"]} parse/0: instruction: 1 parse/0: ingredient: {name: "10", value: 0, type: 0, properties: ["10": "literal"]} -parse/0: product: {name: "default-space", value: 0, type: 2-0, properties: ["default-space": "address":"space"]} +parse/0: product: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} parse/0: instruction: 1 parse/0: ingredient: {name: "20", value: 0, type: 0, properties: ["20": "literal"]} -parse/0: product: {name: "0", value: 0, type: 2-0, properties: ["0": "address":"space", "names": "dummy"]} +parse/0: product: {name: "0", value: 0, type: 2-5-1, properties: ["0": "address":"array":"location", "names": "dummy"]} parse/0: instruction: 1 parse/0: ingredient: {name: "32", value: 0, type: 0, properties: ["32": "literal"]} parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} diff --git a/cpp/043space b/cpp/043space index c285f65f..cc9c161e 100644 --- a/cpp/043space +++ b/cpp/043space @@ -8,7 +8,7 @@ # then location 0 is really location 11, location 1 is really location 12, and so on. recipe main [ 10:integer <- copy 5:literal # pretend array; in practice we'll use new - default-space:address:space <- copy 10:literal + default-space:address:array:location <- copy 10:literal 1:integer <- copy 23:literal ] +mem: storing 23 in location 12 @@ -20,7 +20,7 @@ recipe main [ # pretend array 1000:integer <- copy 5:literal # actual start of this function - default-space:address:space <- copy 1000:literal + default-space:address:array:location <- copy 1000:literal 1:address:integer <- copy 3:literal 8:integer/raw <- copy 1:address:integer/deref ] @@ -62,7 +62,7 @@ recipe main [ # pretend array 1000:integer <- copy 5:literal # actual start of this function - default-space:address:space <- copy 1000:literal + default-space:address:array:location <- copy 1000:literal 1:address:point <- copy 12:literal 9:integer/raw <- get 1:address:point/deref, 1:offset ] @@ -82,7 +82,7 @@ recipe main [ # pretend array 1000:integer <- copy 5:literal # actual start of this function - default-space:address:space <- copy 1000:literal + default-space:address:array:location <- copy 1000:literal 1:address:array:integer <- copy 12:literal 9:integer/raw <- index 1:address:array:integer/deref, 1:literal ] @@ -118,8 +118,8 @@ int address(int offset, int base) { :(scenario "get_default_space") recipe main [ - default-space:address:space <- copy 10:literal - 1:integer/raw <- copy default-space:address:space + default-space:address:array:location <- copy 10:literal + 1:integer/raw <- copy default-space:address:array:location ] +mem: storing 10 in location 1 diff --git a/cpp/044space_surround b/cpp/044space_surround index 76cd5807..6e16fd23 100644 --- a/cpp/044space_surround +++ b/cpp/044space_surround @@ -9,8 +9,8 @@ recipe main [ 10:integer <- copy 5:literal # pretend array 20:integer <- copy 5:literal # pretend array - default-space:address:space <- copy 10:literal - 0:address:space/names:dummy <- copy 20:literal # later layers will explain the /names: property + default-space:address:array:location <- copy 10:literal + 0:address:array:location/names:dummy <- copy 20:literal # later layers will explain the /names: property 1:integer <- copy 32:literal 1:integer/space:1 <- copy 33:literal ] diff --git a/cpp/054closure_name b/cpp/054closure_name index b2ea3cc5..9c61d5cd 100644 --- a/cpp/054closure_name +++ b/cpp/054closure_name @@ -5,24 +5,24 @@ :(scenario "closure") recipe main [ - default-space:address:space <- new location:type, 30:literal - 1:address:space/names:init-counter <- init-counter + default-space:address:array:location <- new location:type, 30:literal + 1:address:array:location/names:init-counter <- init-counter #? $print [AAAAAAAAAAAAAAAA] -#? $print 1:address:space - 2:integer/raw <- increment-counter 1:address:space/names:init-counter - 3:integer/raw <- increment-counter 1:address:space/names:init-counter +#? $print 1:address:array:location + 2:integer/raw <- increment-counter 1:address:array:location/names:init-counter + 3:integer/raw <- increment-counter 1:address:array:location/names:init-counter ] recipe init-counter [ - default-space:address:space <- new location:type, 30:literal + default-space:address:array:location <- new location:type, 30:literal x:integer <- copy 23:literal y:integer <- copy 3:literal # variable that will be incremented - reply default-space:address:space + reply default-space:address:array:location ] recipe increment-counter [ - default-space:address:space <- new space:literal, 30:literal - 0:address:space/names:init-counter <- next-ingredient # outer space must be created by 'init-counter' above + default-space:address:array:location <- new space:literal, 30:literal + 0:address:array:location/names:init-counter <- next-ingredient # outer space must be created by 'init-counter' above y:integer/space:1 <- add y:integer/space:1, 1:literal # increment y:integer <- copy 234:literal # dummy reply y:integer/space:1 @@ -48,10 +48,11 @@ void collect_surrounding_spaces(const recipe_number r) { for (size_t j = 0; j < inst.products.size(); ++j) { if (isa_literal(inst.products[j])) continue; if (inst.products[j].name != "0") continue; - if (inst.products[j].types.size() != 2 + if (inst.products[j].types.size() != 3 || inst.products[j].types[0] != Type_number["address"] - || inst.products[j].types[1] != Type_number["space"]) { - raise << "slot 0 should always have type address:space, but is " << inst.products[j].to_string() << '\n'; + || inst.products[j].types[1] != Type_number["array"] + || inst.products[j].types[2] != Type_number["location"]) { + raise << "slot 0 should always have type address:array:location, but is " << inst.products[j].to_string() << '\n'; continue; } vector<string> s = property(inst.products[j], "names"); diff --git a/cpp/060string.mu b/cpp/060string.mu index 3723df2d..e76d25c8 100644 --- a/cpp/060string.mu +++ b/cpp/060string.mu @@ -1,7 +1,7 @@ # Some useful helpers for dealing with strings. recipe string-equal [ - default-space:address:space <- new location:type, 30:literal + default-space:address:array:location <- new location:type, 30:literal a:address:array:character <- next-ingredient a-len:integer <- length a:address:array:character/deref b:address:array:character <- next-ingredient @@ -34,7 +34,7 @@ recipe string-equal [ scenario string-equal-reflexive [ run [ - default-space:address:space <- new location:type, 30:literal + default-space:address:array:location <- new location:type, 30:literal x:address:array:character <- new [abc] 3:boolean/raw <- string-equal x:address:array:character, x:address:array:character ] @@ -45,7 +45,7 @@ scenario string-equal-reflexive [ scenario string-equal-identical [ run [ - default-space:address:space <- new location:type, 30:literal + default-space:address:array:location <- new location:type, 30:literal x:address:array:character <- new [abc] y:address:array:character <- new [abc] 3:boolean/raw <- string-equal x:address:array:character, y:address:array:character @@ -57,7 +57,7 @@ scenario string-equal-identical [ scenario string-equal-distinct-lengths [ run [ - default-space:address:space <- new location:type, 30:literal + default-space:address:array:location <- new location:type, 30:literal x:address:array:character <- new [abc] y:address:array:character <- new [abcd] 3:boolean/raw <- string-equal x:address:array:character, y:address:array:character @@ -75,7 +75,7 @@ scenario string-equal-distinct-lengths [ scenario string-equal-with-empty [ run [ - default-space:address:space <- new location:type, 30:literal + default-space:address:array:location <- new location:type, 30:literal x:address:array:character <- new [] y:address:array:character <- new [abcd] 3:boolean/raw <- string-equal x:address:array:character, y:address:array:character @@ -87,7 +87,7 @@ scenario string-equal-with-empty [ scenario string-equal-common-lengths-but-distinct [ run [ - default-space:address:space <- new location:type, 30:literal + default-space:address:array:location <- new location:type, 30:literal x:address:array:character <- new [abc] y:address:array:character <- new [abd] 3:boolean/raw <- string-equal x:address:array:character, y:address:array:character @@ -104,8 +104,8 @@ container buffer [ ] recipe init-buffer [ - default-space:address:space <- new location:type, 30:literal -#? $print default-space:address:space + default-space:address:array:location <- new location:type, 30:literal +#? $print default-space:address:array:location #? $print [ #? ] result:address:buffer <- new buffer:type @@ -121,7 +121,7 @@ recipe init-buffer [ ] recipe grow-buffer [ - default-space:address:space <- new location:type, 30:literal + default-space:address:array:location <- new location:type, 30:literal in:address:buffer <- next-ingredient # double buffer size x:address:address:array:character <- get-address in:address:buffer/deref, data:offset @@ -144,7 +144,7 @@ recipe grow-buffer [ ] recipe buffer-full? [ - default-space:address:space <- new location:type, 30:literal + default-space:address:array:location <- new location:type, 30:literal in:address:buffer <- next-ingredient len:integer <- get in:address:buffer/deref, length:offset s:address:array:character <- get in:address:buffer/deref, data:offset @@ -155,7 +155,7 @@ recipe buffer-full? [ # in:address:buffer <- buffer-append in:address:buffer, c:character recipe buffer-append [ - default-space:address:space <- new location:type, 30:literal + default-space:address:array:location <- new location:type, 30:literal in:address:buffer <- next-ingredient c:character <- next-ingredient { @@ -174,7 +174,7 @@ recipe buffer-append [ scenario buffer-append-works [ run [ - default-space:address:space <- new location:type, 30:literal + default-space:address:array:location <- new location:type, 30:literal x:address:buffer <- init-buffer 3:literal s1:address:array:character <- get x:address:buffer/deref, data:offset x:address:buffer <- buffer-append x:address:buffer, 97:literal # 'a' @@ -233,7 +233,7 @@ scenario buffer-append-works [ # result:address:array:character <- integer-to-decimal-string n:integer recipe integer-to-decimal-string [ - default-space:address:space <- new location:type, 30:literal + default-space:address:array:location <- new location:type, 30:literal n:integer <- next-ingredient # is it zero? { @@ -325,7 +325,7 @@ scenario integer-to-decimal-digit-negative [ ] recipe string-append [ - default-space:address:space <- new location:type, 30:literal + default-space:address:array:location <- new location:type, 30:literal # result = new string[a.length + b.length] a:address:array:character <- next-ingredient a-len:integer <- length a:address:array:character/deref |