Permalink
Browse files

Move builtins to a separate file that all libraries have use of

  • Loading branch information...
Whiteknight committed Nov 27, 2011
1 parent cc0f081 commit bf8d34718dec540b25f58a8e4fe5d41fbe3506c4
Showing with 38 additions and 39 deletions.
  1. +1 −1 setup.winxed
  2. +37 −0 src/include/Builtins.winxed
  3. +0 −38 src/include/Core.winxed
View
@@ -393,7 +393,7 @@ function setup_lib_internal(var rosella, string name, string prefix,
setup_lib_constants(rosella, name, prefix, named);
// Get a list of all files
- var files = [];
+ var files = ["src/include/Builtins.winxed"];
for (string include in includes)
push(files, "src/include/" + include + ".winxed");
for (string file in files_raw)
@@ -0,0 +1,37 @@
+/* Inline helpers
+*/
+
+inline can(var obj, string method) return int
+{
+ int can_do;
+ ${ can can_do, obj, method };
+ return can_do;
+}
+
+inline isa(var obj, var class_obj) return int
+{
+ int isa_class;
+ ${ isa isa_class, obj, class_obj };
+ return isa_class;
+}
+
+inline get_class(var class_obj) return var
+{
+ var type;
+ ${ get_class class_obj, type };
+ return type;
+}
+
+inline does(var obj, string role) return int
+{
+ int does_role;
+ ${ does does_role, obj, role };
+ return does_role;
+}
+
+inline new(var class_obj) return var
+{
+ var obj;
+ ${ new obj, class_obj };
+ return obj;
+}
View
@@ -79,44 +79,6 @@ namespace Rosella {
class Version;
}
-/* Inline helpers
-*/
-
-inline can(var obj, string method) return int
-{
- int can_do;
- ${ can can_do, obj, method };
- return can_do;
-}
-
-inline isa(var obj, var class_obj) return int
-{
- int isa_class;
- ${ isa isa_class, obj, class_obj };
- return isa_class;
-}
-
-inline get_class(var class_obj) return var
-{
- var type;
- ${ get_class class_obj, type };
- return type;
-}
-
-inline does(var obj, string role) return int
-{
- int does_role;
- ${ does does_role, obj, role };
- return does_role;
-}
-
-inline new(var class_obj) return var
-{
- var obj;
- ${ new obj, class_obj };
- return obj;
-}
-
/* Load the Library
*/

0 comments on commit bf8d347

Please sign in to comment.