]> gitweb.factorcode.org Git - factor.git/commitdiff
Fix docs
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 23 Apr 2009 02:20:36 +0000 (21:20 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 23 Apr 2009 02:20:36 +0000 (21:20 -0500)
core/kernel/kernel-docs.factor
core/syntax/syntax-docs.factor
core/words/words-docs.factor

index 36d04f1437eabe8176f5e9b8783fb17a163efab7..371edcf9955babeee1743349e7e72d5768a77129 100644 (file)
@@ -182,12 +182,14 @@ HELP: either?
 
 HELP: call
 { $values { "callable" callable } }
-{ $description "Calls a quotation." }
+{ $description "Calls a quotation. Words which " { $link call } " an input parameter must be declared " { $link POSTPONE: inline } " so that a caller which passes in a literal quotation can have a static stack effect." }
 { $examples
     "The following two lines are equivalent:"
     { $code "2 [ 2 + 3 * ] call" "2 2 + 3 *" }
 } ;
 
+{ call POSTPONE: call( } related-words
+
 HELP: call-clear ( quot -- )
 { $values { "quot" callable } }
 { $description "Calls a quotation with an empty call stack. If the quotation returns, Factor will exit.." }
index 73335e09cf40278b28dc4453bd7a54100418dffe..a0e1d280d5e6ef665099079533f8688d36b2e7bb 100644 (file)
@@ -791,7 +791,14 @@ HELP: call-next-method
 
 HELP: call(
 { $syntax "call( stack -- effect )" }
-{ $description "Calls the quotation on the top of the stack, asserting that it has the given stack effect. The quotation does not need to be known at compile time." } ;
+{ $description "Calls the quotation on the top of the stack, asserting that it has the given stack effect. The quotation does not need to be known at compile time." }
+{ $examples
+  { $code
+    "TUPLE: action name quot ;"
+    ": perform-action ( action -- )"
+    "    [ name>> print ] [ quot>> call( -- ) ] bi ;"
+  }
+} ;
 
 HELP: execute(
 { $syntax "execute( stack -- effect )" }
index 58cc3c4f494556d110f4643b738949bd39dc4e32..9cc1f5b2b9aeecfcb1a6f76cc8588d4b153bd41c 100644 (file)
@@ -160,7 +160,7 @@ ABOUT: "words"
 
 HELP: execute ( word -- )
 { $values { "word" word } }
-{ $description "Executes a word. Words which call execute must be inlined in order to compile when called from other words." }
+{ $description "Executes a word. Words which " { $link execute } " an input parameter must be declared " { $link POSTPONE: inline } " so that a caller which passes in a literal word can have a static stack effect." }
 { $examples
     { $example "USING: kernel io words ;" "IN: scratchpad" ": twice ( word -- ) dup execute execute ; inline\n: hello ( -- ) \"Hello\" print ;\n\\ hello twice" "Hello\nHello" }
 } ;