]> gitweb.factorcode.org Git - factor.git/commitdiff
latest UI work
authorSlava Pestov <slava@factorcode.org>
Fri, 26 Aug 2005 05:44:12 +0000 (05:44 +0000)
committerSlava Pestov <slava@factorcode.org>
Fri, 26 Aug 2005 05:44:12 +0000 (05:44 +0000)
library/help/tutorial.factor

index 7dc018382c21a45123f74d360f2a51a3d8b2be19..c7a6fbb03113eed6ab8ccbfa678039b96b7c5169 100644 (file)
@@ -15,9 +15,8 @@ GENERIC: tutorial-line ( object -- gadget )
 M: string tutorial-line <label> ;\r
 \r
 : example-theme\r
-    dup roll-button-theme\r
-    dup "Monospaced" font set-paint-prop\r
-    italic font-style set-paint-prop ;\r
+    dup button-theme\r
+    "Monospaced" font set-paint-prop ;\r
 \r
 M: general-list tutorial-line\r
     car dup <label> dup rot [ pane get pane-input set-editor-text drop ] cons\r
@@ -181,15 +180,6 @@ M: general-list tutorial-line
             ""\r
             "Prefixing a word with \\ pushes it on the stack, instead of"\r
             "executing it. So the see word has stack effect ( word -- )."\r
-        ] [\r
-            "Booleans"\r
-            "In Factor, any object can be used as a truth value."\r
-            "- The f object is false."\r
-            "- Anything else is true."\r
-            ""\r
-            "Here is a word that outputs a boolean:"\r
-            ""\r
-            [ ": negative? ( n -- ? ) 0 < ;" ]\r
         ] [\r
             "Branches"\r
             "Now suppose we want to write a word that computes the"\r
@@ -198,18 +188,22 @@ M: general-list tutorial-line
             ""\r
             [ ": absolute ( x -- |x| ) dup 0 < [ negate ] when ;" ]\r
             ""\r
-            "It duplicates the top of the stack, since negative? pops it."\r
-            "Then if the top of the stack was found to be negative,"\r
-            "it is negated, yielding a postive result."\r
+            "If the top of the stack is negative, the word negates it"\r
+            "again, making it positive."\r
+            ""\r
+            "The < ( x y -- x<y ) word outputs a boolean."\r
+            "In Factor, any object can be used as a truth value."\r
+            "- The f object is false."\r
+            "- Anything else is true."\r
         ] [\r
             "More branches"\r
             "On the previous slide, you saw the 'when' conditional:"\r
             ""\r
-            [ "  ... condition ... [ ... code to run if true ... ] when" ]\r
+            [ "  ... condition ... [ ... true case ... ] when" ]\r
             ""\r
             "Another commonly-used form is 'unless':"\r
             ""\r
-            [ "  ... condition ... [ ... code to run if true ... ] unless" ]\r
+            [ "  ... condition ... [ ... false case ... ] unless" ]\r
             ""\r
             "The 'ifte' conditional takes action on both branches:"\r
             ""\r