]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/fry/fry-docs.factor
Updating code for make and fry changes
[factor.git] / basis / fry / fry-docs.factor
index 4f33a6892a30be49276ad3bb657d9d6bf183b86e..286dbb469ef98eded169bab8b8ca981a1e6e06e2 100755 (executable)
@@ -1,7 +1,7 @@
 USING: help.markup help.syntax quotations kernel ;\r
 IN: fry\r
 \r
-HELP: ,\r
+HELP: _\r
 { $description "Fry specifier. Inserts a literal value into the fried quotation." } ;\r
 \r
 HELP: @\r
@@ -16,7 +16,7 @@ HELP: fry
 \r
 HELP: '[\r
 { $syntax "code... ]" }\r
-{ $description "Literal fried quotation. Expands into code which takes values from the stack and substitutes them in place of the fry specifiers " { $link , } " and " { $link @ } "." }\r
+{ $description "Literal fried quotation. Expands into code which takes values from the stack and substitutes them in place of the fry specifiers " { $link _ } " and " { $link @ } "." }\r
 { $examples "See " { $link "fry.examples" } "." } ;\r
 \r
 ARTICLE: "fry.examples" "Examples of fried quotations"\r
@@ -24,49 +24,49 @@ ARTICLE: "fry.examples" "Examples of fried quotations"
 $nl\r
 "If a quotation does not contain any fry specifiers, then " { $link POSTPONE: '[ } " behaves just like " { $link POSTPONE: [ } ":"\r
 { $code "{ 10 20 30 } '[ . ] each" }\r
-"Occurrences of " { $link , } " on the left map directly to " { $link curry } ". That is, the following three lines are equivalent:"\r
+"Occurrences of " { $link _ } " on the left map directly to " { $link curry } ". That is, the following three lines are equivalent:"\r
 { $code \r
-    "{ 10 20 30 } 5 '[ , + ] map"\r
+    "{ 10 20 30 } 5 '[ _ + ] map"\r
     "{ 10 20 30 } 5 [ + ] curry map"\r
     "{ 10 20 30 } [ 5 + ] map"\r
 }\r
-"Occurrences of " { $link , } " in the middle of a quotation map to more complex quotation composition patterns. The following three lines are equivalent:"\r
+"Occurrences of " { $link _ } " in the middle of a quotation map to more complex quotation composition patterns. The following three lines are equivalent:"\r
 { $code \r
-    "{ 10 20 30 } 5 '[ 3 , / ] map"\r
+    "{ 10 20 30 } 5 '[ 3 _ / ] map"\r
     "{ 10 20 30 } 5 [ 3 ] swap [ / ] curry compose map"\r
     "{ 10 20 30 } [ 3 5 / ] map"\r
 }\r
-"Occurrences of " { $link @ } " are simply syntax sugar for " { $snippet ", call" } ". The following four lines are equivalent:"\r
+"Occurrences of " { $link @ } " are simply syntax sugar for " { $snippet "_ call" } ". The following four lines are equivalent:"\r
 { $code \r
     "{ 10 20 30 } [ sq ] '[ @ . ] each"\r
     "{ 10 20 30 } [ sq ] [ call . ] curry each"\r
     "{ 10 20 30 } [ sq ] [ . ] compose each"\r
     "{ 10 20 30 } [ sq . ] each"\r
 }\r
-"The " { $link , } " and " { $link @ } " specifiers may be freely mixed:"\r
+"The " { $link _ } " and " { $link @ } " specifiers may be freely mixed:"\r
 { $code\r
-    "{ 8 13 14 27 } [ even? ] 5 '[ @ dup , ? ] map"\r
+    "{ 8 13 14 27 } [ even? ] 5 '[ @ dup _ ? ] map"\r
     "{ 8 13 14 27 } [ even? ] 5 [ dup ] swap [ ? ] curry 3compose map"\r
     "{ 8 13 14 27 } [ even? dup 5 ? ] map"\r
 }\r
 "Here are some built-in combinators rewritten in terms of fried quotations:"\r
 { $table\r
-    { { $link literalize } { $snippet ": literalize '[ , ] ;" } }\r
-    { { $link slip } { $snippet ": slip '[ @ , ] call ;" } }\r
-    { { $link curry } { $snippet ": curry '[ , @ ] ;" } }\r
+    { { $link literalize } { $snippet ": literalize '[ _ ] ;" } }\r
+    { { $link slip } { $snippet ": slip '[ @ _ ] call ;" } }\r
+    { { $link curry } { $snippet ": curry '[ _ @ ] ;" } }\r
     { { $link compose } { $snippet ": compose '[ @ @ ] ;" } }\r
-    { { $link bi@ } { $snippet ": bi@ tuck '[ , @ , @ ] call ;" } }\r
+    { { $link bi@ } { $snippet ": bi@ tuck '[ _ @ _ @ ] call ;" } }\r
 } ;\r
 \r
 ARTICLE: "fry.philosophy" "Fried quotation philosophy"\r
 "Fried quotations generalize quotation-building words such as " { $link curry } " and " { $link compose } ". They can clean up code with lots of currying and composition, particularly when quotations are nested:"\r
 { $code\r
-    "'[ [ , key? ] all? ] filter"\r
+    "'[ [ _ key? ] all? ] filter"\r
     "[ [ key? ] curry all? ] curry filter"\r
 }\r
 "There is a mapping from fried quotations to lexical closures as defined in the " { $vocab-link "locals" } " vocabulary. Namely, a fried quotation is equivalent to a ``let'' form where each local binding is only used once, and bindings are used in the same order in which they are defined. The following two lines are equivalent:"\r
 { $code\r
-    "'[ 3 , + 4 , / ]"\r
+    "'[ 3 _ + 4 _ / ]"\r
     "[let | a [ ] b [ ] | [ 3 a + 4 b / ] ]"\r
 } ;\r
 \r
@@ -79,7 +79,7 @@ $nl
 "Fried quotations are denoted with a special parsing word:"\r
 { $subsection POSTPONE: '[ }\r
 "Fried quotations contain zero or more " { $emphasis "fry specifiers" } ":"\r
-{ $subsection , }\r
+{ $subsection _ }\r
 { $subsection @ }\r
 "When a fried quotation is being evaluated, values are consumed from the stack and spliced into the quotation from right to left."\r
 { $subsection "fry.examples" }\r