//: Spaces help isolate recipes from each other. You can create them at will, //: and all addresses in arguments are implicitly based on the 'default-space' //: (unless they have the /raw property) //: //: Spaces are often called 'scopes' in other languages. Stack frames are a //: limited form of space that can't outlive callers. //: //: Warning: messing with 'default-space' can corrupt memory. Don't share //: default-space between recipes. Later we'll see how to chain spaces safely. //: //: Tests in this layer can write to a location as part of one type, and read //: it as part of another. This is unsafe and insecure, and we'll stop doing //: this once we switch to variable names. //: Under the hood, a space is an array of locations in memory. :(before "End Mu Types Initialization") put(Type_abbreviations, "space", new_type_tree("address:array:location")); :(scenario set_default_space) def main [ # prepare default-space address 10:num/alloc-id, 11:num <- copy 0, 1000 # prepare default-space payload 1000:num <- copy 0 # alloc id of payload 1001:num <- copy 5 # length # actual start of this recipe default-space:space <- copy 10:&:@:location # if default-space is 1000, then: # 1000: alloc id # 1001: array size # 1002: location 0 (space for the chaining slot; described later; often unused) # 1003: location 1 (space for the chaining slot; described later; often unused) # 1004: local 2 (assuming it is a scalar) 2:num <- copy 93 ] +mem: storing 93 in location 1004 :(scenario lookup_sidesteps_default_space) def main [ # prepare default-space address 10:num/alloc-id, 11:num <- copy 0, 1000 # prepare default-space payload 1000:num <- copy 0 # alloc id of payload 1001:num <- copy 5 # length # prepare payload outside the local scope 2000:num/alloc-id, 2001:num <- copy 0, 34 # actual start of this recipe default-space:space <- copy 10:&:@:location # a local address 2:num, 3:num <- copy 0, 2000 20:num/raw <- copy *2:&:num ] +mem: storing 2000 in location 1005 +mem: storing 34 in location 20 //: precondition: disable name conversion for 'default-space' :(scenarios transform) :(scenario convert_names_passes_default_space) % Hide_errors = true; def main [ default-space:num <- copy 0 x:num <- copy 1 ] +name: assign x 2 -name: assign default-space 1 -name: assign default-space 2 :(scenarios run) :(before "End is_disqualified Special-cases") if (x.name == "default-space") x.initialized = true; :(before "End is_special_name Special-cases") if (s == "default-space") return true; //: core implementation :(before "End call Fields") int default_space; :(before "End call Constructor") default_space = 0; :(before "Begin canonize(x) Lookups") absolutize(x); :(code) void absolutize(reagent& x) { if (is_raw(x) || is_dummy(x)) return; if (x.name == "default-space") return; if (!x.initialized) raise << to_original_string(current_instruction()) << ": reagent not initialized: '" << x.original_string << "'\n" << end(); x.set_value(address(x.value, space_base(x))); x.properties.push_back(pair("raw", NULL)); assert(is_raw(x)); } //: hook replaced in a later layer int space_base(const reagent& x) { return current_call().default_space ? (current_call().default_space + /*skip alloc id*/1) : 0; } int address(int offset, int base) { assert(offset >= 0); if (base == 0) return offset; // raw int size = get_or_insert(Memory, base); if (offset
Installing
==========

Use the package manager of your operating system to install ranger.

To install ranger manually, use either:
sudo ./setup.py install --optimize=1 --record=install_log.txt

or for short:
sudo make install


Uninstalling
============

Again, use your package manager to uninstall ranger.  No other way for
automatically removing ranger is supported!

However, if you installed ranger with the command above, all installed files
have been recorded to "install_log.txt".  This information can be used to remove
ranger by hand, e.g.:

cat install_log.txt | sed s/\^/\\// | xargs -d "\n" sudo rm --
pecial_name(const recipe_ordinal r) { for (map::iterator p = Name[r].begin(); p != Name[r].end(); ++p) { if (p->first.empty()) continue; if (p->first.find("stash_") == 0) continue; // generated by rewrite_stashes_to_text (cross-layer) if (!is_special_name(p->first)) return true; } return false; }