From 3fc5f8e8e10a8fbd32db1c6c0ca493503e6f8514 Mon Sep 17 00:00:00 2001 From: Jonathan Turner Date: Thu, 16 Jul 2009 20:32:33 +0000 Subject: [PATCH] Guard push_back to ensure we have the push_back_ref before we call it --- include/chaiscript/language/chaiscript_prelude.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/chaiscript/language/chaiscript_prelude.hpp b/include/chaiscript/language/chaiscript_prelude.hpp index fe632ef..39d0111 100644 --- a/include/chaiscript/language/chaiscript_prelude.hpp +++ b/include/chaiscript/language/chaiscript_prelude.hpp @@ -41,7 +41,7 @@ def odd(x) { if (x % 2 == 1) { true } else { false } } \ # Returns true if the value is even\n\ def even(x) { if (x % 2 == 0) { true } else { false } } \ # Pushes the second value onto the container first value while making a clone of the value\n\ -def push_back(container, x) { container.push_back_ref(clone(x)) } \n\ +def push_back(container, x) : call_exists(push_back_ref, container) { container.push_back_ref(clone(x)) } \n\ # Inserts the third value at the position of the second value into the container of the first\n\ # while making a clone. \n\ def insert_at(container, pos, x) { container.insert_ref_at(pos, clone(x)); } \n\