From 59b6a42aac60a8be4b637a6a1cffa2bf371e7302 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Wed, 18 Nov 2015 13:50:37 -0800 Subject: 2459 --- 032array.cc | 12 ++++++++++++ 043new.cc | 10 ---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/032array.cc b/032array.cc index 2bdafbbf..ac883490 100644 --- a/032array.cc +++ b/032array.cc @@ -423,3 +423,15 @@ case LENGTH: { recipe_ordinal r = current_instruction().operation; if (r == CREATE_ARRAY || r == INDEX || r == INDEX_ADDRESS || r == LENGTH) return false; + +//: a particularly common array type is the string, or address:array:character +:(code) +bool is_mu_string(const reagent& x) { + return x.type + && x.type->value == get(Type_ordinal, "address") + && x.type->right + && x.type->right->value == get(Type_ordinal, "array") + && x.type->right->right + && x.type->right->right->value == get(Type_ordinal, "character") + && x.type->right->right->right == NULL; +} diff --git a/043new.cc b/043new.cc index dd0fac14..c3f48bce 100644 --- a/043new.cc +++ b/043new.cc @@ -424,16 +424,6 @@ long long int unicode_length(const string& s) { return result; } -bool is_mu_string(const reagent& x) { - return x.type - && x.type->value == get(Type_ordinal, "address") - && x.type->right - && x.type->right->value == get(Type_ordinal, "array") - && x.type->right->right - && x.type->right->right->value == get(Type_ordinal, "character") - && x.type->right->right->right == NULL; -} - string read_mu_string(long long int address) { long long int size = get_or_insert(Memory, address); if (size == 0) return ""; -- cgit 1.4.1-2-gfad0