]> gitweb.factorcode.org Git - factor.git/commitdiff
alien.syntax: Add ENUM: example with c basetype.
authorDoug Coleman <doug.coleman@gmail.com>
Sat, 5 Mar 2016 23:34:15 +0000 (15:34 -0800)
committerDoug Coleman <doug.coleman@gmail.com>
Sat, 5 Mar 2016 23:34:15 +0000 (15:34 -0800)
basis/alien/syntax/syntax-docs.factor

index 923b31a5f5c6ef8849d2e1b42c1eaf7b4276c4fe..5c6e25c7c26ca4c03cad48ef0100987e77b8bc93 100644 (file)
@@ -73,6 +73,12 @@ HELP: ENUM:
     { $code "ENUM: color_t red { green 3 } blue ;" }
     "The following expression returns true:"
     { $code "3 <color_t> [ green = ] [ enum>number 3 = ] bi and" }
+
+    "Here is a version where the C-type takes a single byte:"
+    { $code "ENUM: tv_peripherals_1 < uchar\n{ appletv 1 } { chromecast 2 } { roku 4 } ;" }
+
+    "The same as above but four bytes instead of one:"
+    { $code "ENUM: tv_peripherals_4 < uint\n{ appletv 1 } { chromecast 2 } { roku 4 } ;" }
 } ;
 
 HELP: C-TYPE: