From f344b250f6f062a1a1902bf69b23ebf9b565de0e Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 17 Sep 2016 15:01:51 -0700 Subject: 3395 --- html/034address.cc.html | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'html/034address.cc.html') diff --git a/html/034address.cc.html b/html/034address.cc.html index f809d2fb..ea739cf3 100644 --- a/html/034address.cc.html +++ b/html/034address.cc.html @@ -80,7 +80,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color //: sufficient space to hold that type, and returns an address (bookmark) //: to the allocated space. //: -//: x:address:number <- new number:type +//: x:address:num <- new number:type //: //: +------------+ //: x -------> | number | @@ -118,7 +118,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color //: The refcount of 1 here indicates that this number has one bookmark //: outstanding. If you then make a copy of x, the refcount increments: //: -//: y:address:number <- copy x +//: y:address:num <- copy x //: //: x ---+ +---+------------+ //: +---> | 2 | number | @@ -158,15 +158,15 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color # call 'new' two times with identical types without modifying the results; you # should get back different results def main [ - 1:address:number/raw <- new number:type - 2:address:number/raw <- new number:type - 3:boolean/raw <- equal 1:address:number/raw, 2:address:number/raw + 1:address:num/raw <- new number:type + 2:address:num/raw <- new number:type + 3:bool/raw <- equal 1:address:num/raw, 2:address:num/raw ] +mem: storing 0 in location 3 :(scenario dilated_reagent_with_new) def main [ - 1:address:address:number <- new {(address number): type} + 1:address:address:num <- new {(address number): type} ] +new: size of ("address" "number") is 1 @@ -376,15 +376,15 @@ put(Recipe_ordinal,% Memory_allocated_until = 10; % put(Memory, Memory_allocated_until, 1); def main [ - 1:address:number <- new number:type + 1:address:num <- new number:type ] +mem: storing 0 in location 10 :(scenario new_array) def main [ - 1:address:array:number/raw <- new number:type, 5 - 2:address:number/raw <- new number:type - 3:number/raw <- subtract 2:address:number/raw, 1:address:array:number/raw + 1:address:array:num/raw <- new number:type, 5 + 2:address:num/raw <- new number:type + 3:num/raw <- subtract 2:address:num/raw, 1:address:array:num/raw ] +run: {1: ("address" "array" "number"), "raw": ()} <- new {number: "type"}, {5: "literal"} +mem: array length is 5 @@ -393,9 +393,9 @@ def main [ :(scenario new_empty_array) def main [ - 1:address:array:number/raw <- new number:type, 0 - 2:address:number/raw <- new number:type - 3:number/raw <- subtract 2:address:number/raw, 1:address:array:number/raw + 1:address:array:num/raw <- new number:type, 0 + 2:address:num/raw <- new number:type + 3:num/raw <- subtract 2:address:num/raw, 1:address:array:num/raw ] +run: {1: ("address" "array" "number"), "raw": ()} <- new {number: "type"}, {0: "literal"} +mem: array length is 0 @@ -406,7 +406,7 @@ def main [ :(scenario new_overflow) % Initial_memory_per_routine = 3; // barely enough room for point allocation below def main [ - 1:address:number/raw <- new number:type + 1:address:num/raw <- new number:type 2:address:point/raw <- new point:type # not enough room in initial page ] +new: routine allocated memory from 1000 to 1003 -- cgit 1.4.1-2-gfad0