From cefb541c338b5762bfc6a48d32a65110e955cfc6 Mon Sep 17 00:00:00 2001 From: Joe Groff <arcata@gmail.com> Date: Mon, 7 Mar 2011 09:28:51 -0800 Subject: [PATCH] kernel: add a note to the documentation for "dip" and "if" that they are primitive for certain arguments --- core/kernel/kernel-docs.factor | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/kernel/kernel-docs.factor b/core/kernel/kernel-docs.factor index 98b60b1238..1fbd7c64dc 100644 --- a/core/kernel/kernel-docs.factor +++ b/core/kernel/kernel-docs.factor @@ -582,7 +582,8 @@ $nl "10 3 < [ \"Math is broken\" print ] [ \"Math is good\" print ] if" "Math is good" } -} ; +} +{ $notes { $snippet "if" } " is executed as a primitive when preceded by two literal quotations. The below definition is not executed unless one of its arguments is a non-literal quotation, such as a quotation constructed with " { $link curry } " or " { $link compose } ", or for " { $link "fry" } " or quotations including " { $link "locals" } "." } ; HELP: when { $values { "?" "a generalized boolean" } { "true" quotation } } @@ -795,7 +796,8 @@ HELP: dip { $description "Removes " { $snippet "x" } " from the datastack, calls " { $snippet "quot" } ", and restores " { $snippet "x" } " to the top of the datastack when " { $snippet "quot" } " is finished." } { $examples { $example "USING: arrays kernel math prettyprint ;" "10 20 30 [ / ] dip 2array ." "{ 1/2 30 }" } -} ; +} +{ $notes { $snippet "dip" } " is executed as a primitive when preceded by a literal quotation. The below definition is not executed unless its argument is a non-literal quotation, such as a quotation constructed with " { $link curry } " or " { $link compose } ", or for " { $link "fry" } " or quotations including " { $link "locals" } "." } ; HELP: 2dip { $values { "x" object } { "y" object } { "quot" quotation } }