From c5ffb6e1cc9c5ff880d037c53b8ebc8562be0008 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 25 May 2015 22:27:19 -0700 Subject: 1459 --- html/031address.cc.html | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) (limited to 'html/031address.cc.html') diff --git a/html/031address.cc.html b/html/031address.cc.html index e54f6df1..0b7759c3 100644 --- a/html/031address.cc.html +++ b/html/031address.cc.html @@ -2,7 +2,7 @@ -~/Desktop/s/mu/031address.cc +031address.cc @@ -42,12 +42,9 @@ recipe main [ # This loads location 1 as an address and looks up *that* location. 3:number <- copy 1:address:number/deref ] -+run: instruction main/2 -+mem: location 1 is 2 -+mem: location 2 is 34 +mem: storing 34 in location 3 -:(before "index_t base = x.value" following "vector<double> read_memory(reagent x)") +:(before "long long int base = x.value" following "vector<double> read_memory(reagent x)") x = canonize(x); //: similarly, write to addresses pointing at other locations using the @@ -57,11 +54,9 @@ recipe main [ 1:address:number <- copy 2:literal 1:address:number/deref <- copy 34:literal ] -+run: instruction main/1 -+mem: location 1 is 2 +mem: storing 34 in location 2 -:(before "index_t base = x.value" following "void write_memory(reagent x, vector<double> data)") +:(before "long long int base = x.value" following "void write_memory(reagent x, vector<double> data)") x = canonize(x); :(code) @@ -83,14 +78,14 @@ reagent deref(reagent x)< // compute value result.set_value(Memory[x.value]); - trace("mem") << "location " << x.value << " is " << result.value; + trace(Primitive_recipe_depth, "mem") << "location " << x.value << " is " << result.value; // populate types copy(++x.types.begin(), x.types.end(), inserter(result.types, result.types.begin())); // drop-one 'deref' - index_t i = 0; - size_t len = x.properties.size(); + long long int i = 0; + long long int len = SIZE(x.properties); for (i = 0; i < len; ++i) { if (x.properties.at(i).first == "deref") break; result.properties.push_back(x.properties.at(i)); @@ -110,9 +105,6 @@ recipe main [ 3:number <- copy 35:literal 4:number <- get 1:address:point/deref, 0:offset ] -+run: instruction main/3 -+run: address to copy is 2 -+run: product 0 is 4 +mem: storing 34 in location 4 :(scenario include_nonderef_properties) @@ -122,9 +114,6 @@ recipe main [ 3:number <- copy 35:literal 4:number <- get 1:address:point/deref/foo, 0:offset ] -+run: instruction main/3 -+run: address to copy is 2 -+run: product 0 is 4 +mem: storing 34 in location 4 :(after "reagent base = " following "case GET:") @@ -138,9 +127,7 @@ recipe main [ 3:number <- copy 35:literal 4:number <- get-address 1:address:point/deref, 0:offset ] -+run: instruction main/3 -+run: address to copy is 2 -+run: product 0 is 4 ++mem: storing 2 in location 4 :(after "reagent base = " following "case GET_ADDRESS:") base = canonize(base); @@ -149,14 +136,14 @@ base = canonize(base);:(code) bool has_property(reagent x, string name) { - for (index_t i = 0; i < x.properties.size(); ++i) { + for (long long int i = /*skip name:type*/1; i < SIZE(x.properties); ++i) { if (x.properties.at(i).first == name) return true; } return false; } vector<string> property(const reagent& r, const string& name) { - for (index_t p = 0; p != r.properties.size(); ++p) { + for (long long int p = /*skip name:type*/1; p != SIZE(r.properties); ++p) { if (r.properties.at(p).first == name) return r.properties.at(p).second; } -- cgit 1.4.1-2-gfad0