]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/alien/enums/enums.factor
Remove ENUM: f and replace uses with CONSTANTs.
[factor.git] / basis / alien / enums / enums.factor
index bd508df07537e41f43080f0ea089c239778f6acd..97b694f890ba58f87d2a227d52a77ed5dc0f47af 100644 (file)
@@ -1,6 +1,6 @@
 ! (c)2010 Joe Groff bsd license
 USING: accessors alien.c-types arrays combinators delegate fry
-kernel quotations sequences words.symbol ;
+kernel quotations sequences words.symbol words ;
 IN: alien.enums
 
 TUPLE: enum-c-type base-type members ;
@@ -28,6 +28,12 @@ M: enum-c-type c-type-setter
 
 C: <enum-c-type> enum-c-type
 
+: enum>int ( enum enum-c-type -- int )
+    c-type-unboxer-quot call( x -- y ) ; inline
+
+: int>enum ( int enum-c-type -- enum )
+    c-type-boxer-quot call( x -- y ) ; inline
+
 <PRIVATE
 
 : define-enum-members ( member-names -- )