From 288728767877f95e644d02c0f15d5d319832187f Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Wed, 29 Apr 2015 21:49:57 -0700 Subject: 1224 --- cpp/027debug.cc | 21 +++++++++++++++++++++ cpp/090debug.cc | 21 --------------------- 2 files changed, 21 insertions(+), 21 deletions(-) create mode 100644 cpp/027debug.cc delete mode 100644 cpp/090debug.cc diff --git a/cpp/027debug.cc b/cpp/027debug.cc new file mode 100644 index 00000000..d81071e9 --- /dev/null +++ b/cpp/027debug.cc @@ -0,0 +1,21 @@ +//: Recipe to look at elements of containers. + +:(before "End Primitive Recipe Declarations") +_PRINT, +:(before "End Primitive Recipe Numbers") +Recipe_number["$print"] = _PRINT; +:(before "End Primitive Recipe Implementations") +case _PRINT: { + if (isa_literal(current_instruction().ingredients[0])) { + trace("run") << "$print: " << current_instruction().ingredients[0].name; + cout << current_instruction().ingredients[0].name; + break; + } + vector result(read_memory(current_instruction().ingredients[0])); + for (size_t i = 0; i < result.size(); ++i) { + trace("run") << "$print: " << result[i]; + if (i > 0) cout << " "; + cout << result[i]; + } + break; +} diff --git a/cpp/090debug.cc b/cpp/090debug.cc deleted file mode 100644 index d81071e9..00000000 --- a/cpp/090debug.cc +++ /dev/null @@ -1,21 +0,0 @@ -//: Recipe to look at elements of containers. - -:(before "End Primitive Recipe Declarations") -_PRINT, -:(before "End Primitive Recipe Numbers") -Recipe_number["$print"] = _PRINT; -:(before "End Primitive Recipe Implementations") -case _PRINT: { - if (isa_literal(current_instruction().ingredients[0])) { - trace("run") << "$print: " << current_instruction().ingredients[0].name; - cout << current_instruction().ingredients[0].name; - break; - } - vector result(read_memory(current_instruction().ingredients[0])); - for (size_t i = 0; i < result.size(); ++i) { - trace("run") << "$print: " << result[i]; - if (i > 0) cout << " "; - cout << result[i]; - } - break; -} -- cgit 1.4.1-2-gfad0