Add ability to register a user defined type conversion

Currently this adds a fair bit of overhead. It will need to be evaluated
further before it's merged.
This commit is contained in:
Jason Turner
2014-10-28 14:52:24 -06:00
parent 43d6f0cf16
commit 7b42d5307a
8 changed files with 62 additions and 13 deletions

View File

@@ -0,0 +1,11 @@
add_type_conversion(type("string"), type("Type_Info"), fun(s) { return type(s); });
// This looks simple, but it takes the string "string" and using the registered
// conversion above, automatically converts that into a Type_Info object, which then
// allows the Type_Info.name() function to be called
assert_equal("string".name(), "string");