]> gitweb.factorcode.org Git - factor.git/commitdiff
kernel-docs: adds examples to the documentation of ?
authorMarc Michael <yogi@turboland.de>
Tue, 5 Sep 2023 20:38:50 +0000 (22:38 +0200)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 6 Sep 2023 15:47:46 +0000 (08:47 -0700)
core/kernel/kernel-docs.factor

index 50e571a99e2046291bfa0145d4c153cfea1da3aa..38d5f2557e15df1f4bb2880d79c6a92659ebf6e3 100644 (file)
@@ -165,6 +165,18 @@ HELP: clone
 HELP: ?
 { $values { "?" boolean } { "true" object } { "false" object } { "true/false" object } }
 { $description "Chooses between two values depending on the boolean value of " { $snippet "?" } "." }
+{ $examples
+    { $example  
+        "USING: prettyprint ;"
+        "3 4 < \"3 is smaller than 4\" \"3 is not smaller than 4\" ? print" 
+        "3 is smaller than 4" 
+    } 
+    { $example  
+        "USING: prettyprint ;"
+        "4 3 < \"4 is smaller than 3\" \"4 is not smaller than 3\" ? print" 
+        "4 is not smaller than 3" 
+    } 
+} ;
 
 HELP: boolean
 { $class-description "A union of the " { $link POSTPONE: t } " and " { $link POSTPONE: f } " classes." } ;