Make "clone" a chaiscript based operation instead of forcing the user to register a clone method.

This commit is contained in:
Jason Turner
2009-07-24 13:17:00 +00:00
parent 0d3c90a245
commit 0b789004e9
3 changed files with 7 additions and 10 deletions

View File

@@ -13,6 +13,7 @@
#define chaiscript_prelude CODE_STRING(\
def new(x) { eval(type_name(x))(); } \
def clone(x) { eval(type_name(x))(x); } \
# to_string for Pair()\n\
def to_string(x) : call_exists(first, x) && call_exists(second, x) { \
"<" + x.first.to_string() + ", " + x.second.to_string() + ">"; \