about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-07-23 23:27:36 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-07-23 23:27:36 -0700
commit93b7d98351cd7e090dd9a37f2786f4f0758c2c6e (patch)
treed897f40770e7b5ff701b644c3ed9810ff243a9b0
parent235958e8b9c29e1bb4138e912d443daeaae5afcb (diff)
downloadmu-93b7d98351cd7e090dd9a37f2786f4f0758c2c6e.tar.gz
1830
-rw-r--r--020run.cc3
-rw-r--r--032array.cc2
-rw-r--r--044space.cc2
-rw-r--r--edit.mu10
4 files changed, 10 insertions, 7 deletions
diff --git a/020run.cc b/020run.cc
index e5040645..12ae6091 100644
--- a/020run.cc
+++ b/020run.cc
@@ -210,9 +210,12 @@ void write_memory(reagent x, vector<double> data) {
 
 :(code)
 long long int size_of(const reagent& r) {
+  if (r.types.empty()) return 0;
+  // End size_of(reagent) Cases
   return size_of(r.types);
 }
 long long int size_of(const vector<type_ordinal>& types) {
+  if (types.empty()) return 0;
   // End size_of(types) Cases
   return 1;
 }
diff --git a/032array.cc b/032array.cc
index e9aef14c..1231eb8b 100644
--- a/032array.cc
+++ b/032array.cc
@@ -40,7 +40,7 @@ recipe main [
 //: disable the size mismatch check since the destination array need not be initialized
 :(after "bool size_mismatch(const reagent& x, const vector<double>& data)")
 if (x.types.at(0) == Type_ordinal["array"]) return false;
-:(after "long long int size_of(const reagent& r)")
+:(before "End size_of(reagent) Cases")
   if (r.types.at(0) == Type_ordinal["array"]) {
     assert(SIZE(r.types) > 1);
     // skip the 'array' type to get at the element type
diff --git a/044space.cc b/044space.cc
index 40f0f5ba..557ee04c 100644
--- a/044space.cc
+++ b/044space.cc
@@ -52,7 +52,7 @@ reagent absolutize(reagent x) {
 //?   cout << "absolutize " << x.to_string() << '\n'; //? 4
   if (is_raw(x) || is_dummy(x)) return x;
   if (!x.initialized)
-    raise << current_instruction().to_string() << ": reagent not initialized: " << x.to_string() << die();
+    raise << current_instruction().to_string() << ": reagent not initialized: " << x.original_string << die();
   reagent r = x;
   r.set_value(address(r.value, space_base(r)));
   r.properties.push_back(pair<string, vector<string> >("raw", vector<string>()));
diff --git a/edit.mu b/edit.mu
index b0d0d895..7fed9f62 100644
--- a/edit.mu
+++ b/edit.mu
@@ -3215,7 +3215,7 @@ recipe foo [
   x:number <- copy 0
   copy x
 ]]
-    y:address:array:character <- new []
+    y:address:array:character <- new [foo]
     env:address:programming-environment-data <- new-programming-environment screen:address, x:address:array:character, y:address:array:character
     event-loop screen:address, console:address, env:address:programming-environment-data
   ]
@@ -3223,10 +3223,10 @@ recipe foo [
     .                                                                                 run (F10)          .
     .                                                  ┊                                                 .
     .recipe foo [                                      ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
-    .  x:number <- copy 0                              ┊                                                 .
-    .  copy x                                          ┊                                                 .
-    .]                                                 ┊                                                 .
-    .missing type in 'copy x'                          ┊                                                 .
+    .  x:number <- copy 0                              ┊                                                x.
+    .  copy x                                          ┊foo                                              .
+    .]                                                 ┊copy x: reagent not initialized: x               .
+    .missing type in 'copy x'                          ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
     .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊                                                 .
     .                                                  ┊                                                 .
   ]