From 6d007fda037331e7761d2a9ed3a2e435131daf7e Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 11 Nov 2016 15:54:19 -0800 Subject: 3667 --- html/034address.cc.html | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'html/034address.cc.html') diff --git a/html/034address.cc.html b/html/034address.cc.html index 5d2cc554..03c374e6 100644 --- a/html/034address.cc.html +++ b/html/034address.cc.html @@ -41,7 +41,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color //: units (containers or arrays) that may contain many different primitives at //: once. Containers and arrays can grow quite large in complex programs, and //: we'd like some way to efficiently share them between recipes without -//: constantly having to make copies. Right now 'next-ingredient' and 'reply' +//: constantly having to make copies. Right now 'next-ingredient' and 'return' //: copy data across recipe boundaries. To avoid copying large quantities of //: data around, we'll use *addresses*. An address is a bookmark to some //: arbitrary quantity of data (the *payload*). It's a primitive, so it's as @@ -246,10 +246,18 @@ put(Recipe_ordinal,"can't drop2 " << expected_type << " from '" << to_string(r) << "'\n" << end(); return; } + // r.type = r.type->right type_tree* tmp = r.type; r.type = tmp->right; tmp->right = NULL; delete tmp; + // if (!r.type->right) r.type = r.type->left + assert(!r.type->atom); + if (r.type->right) return; + tmp = r.type; + r.type = tmp->left; + tmp->left = NULL; + delete tmp; } :(scenario new_returns_incorrect_type) @@ -259,6 +267,13 @@ put(Recipe_ordinal,+error: main: product of 'new' has incorrect type: '1:bool <- new num:type' +:(scenario new_discerns_singleton_list_from_atom_container) +% Hide_errors = true; +def main [ + 1:address:num/raw <- new {(num): type} # should be '{num: type}' +] ++error: main: product of 'new' has incorrect type: '1:address:num/raw <- new {(num): type}' + :(scenario new_with_type_abbreviation) def main [ 1:address:num/raw <- new num:type -- cgit 1.4.1-2-gfad0