From 18f3df9d4a6611e19c030c8c4e81c54c6371609b Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Tue, 9 Mar 2010 21:02:43 -0800 Subject: [PATCH] more help-lint --- .../mailboxes/mailboxes-docs.factor | 2 +- basis/documents/documents-docs.factor | 2 +- basis/lists/lists-docs.factor | 8 +++---- basis/lists/lists.factor | 4 ++-- core/alien/alien-docs.factor | 6 ++--- core/alien/alien.factor | 6 ++--- core/classes/tuple/tuple-docs.factor | 6 ++--- core/combinators/combinators-docs.factor | 2 +- core/continuations/continuations-docs.factor | 2 +- core/kernel/kernel-docs.factor | 22 +++++++++---------- core/kernel/kernel.factor | 2 +- core/lexer/lexer-docs.factor | 4 ++-- core/math/math-docs.factor | 8 +++---- extra/gpu/buffers/buffers-docs.factor | 2 +- 14 files changed, 38 insertions(+), 38 deletions(-) diff --git a/basis/concurrency/mailboxes/mailboxes-docs.factor b/basis/concurrency/mailboxes/mailboxes-docs.factor index 727efd45d0..461650738e 100644 --- a/basis/concurrency/mailboxes/mailboxes-docs.factor +++ b/basis/concurrency/mailboxes/mailboxes-docs.factor @@ -21,7 +21,7 @@ HELP: block-unless-pred { $values { "mailbox" mailbox } { "timeout" "a " { $link duration } " or " { $link f } } - { "pred" { $quotation "( obj -- ? )" } } + { "pred" { $quotation "( ... message -- ... ? )" } } } { $description "Block the thread if there are no items in the mailbox that return true when the predicate is called with the item on the stack." } ; diff --git a/basis/documents/documents-docs.factor b/basis/documents/documents-docs.factor index a4e02009df..203a6e3b09 100644 --- a/basis/documents/documents-docs.factor +++ b/basis/documents/documents-docs.factor @@ -42,7 +42,7 @@ HELP: doc-lines { $errors "Throws an error if " { $snippet "from" } " or " { $snippet "to" } " is out of bounds." } ; HELP: each-line -{ $values { "from" "a non-negative integer" } { "to" "a non-negative integer" } { "quot" { $quotation "( string -- )" } } } +{ $values { "from" "a non-negative integer" } { "to" "a non-negative integer" } { "quot" { $quotation "( ... line -- ... )" } } } { $description "Applies the quotation to each line in the range." } { $notes "The range is created by calling " { $link } "." } { $errors "Throws an error if " { $snippet "from" } " or " { $snippet "to" } " is out of bounds." } ; diff --git a/basis/lists/lists-docs.factor b/basis/lists/lists-docs.factor index 53fde94687..a3056b0332 100644 --- a/basis/lists/lists-docs.factor +++ b/basis/lists/lists-docs.factor @@ -127,19 +127,19 @@ HELP: unswons { leach foldl lmap>array } related-words HELP: leach -{ $values { "list" list } { "quot" { $quotation "( obj -- )" } } } +{ $values { "list" list } { "quot" { $quotation "( ... elt -- ... )" } } } { $description "Call the quotation for each item in the list." } ; HELP: foldl -{ $values { "list" list } { "identity" "an object" } { "quot" { $quotation "( prev elt -- next )" } } { "result" "the final result" } } +{ $values { "list" list } { "identity" "an object" } { "quot" { $quotation "( ... prev elt -- ... next )" } } { "result" "the final result" } } { $description "Combines successive elements of the list (in a left-assocative order) using a binary operation and outputs the final result." } ; HELP: foldr -{ $values { "list" list } { "identity" "an object" } { "quot" { $quotation "( prev elt -- next )" } } { "result" "the final result" } } +{ $values { "list" list } { "identity" "an object" } { "quot" { $quotation "( ... prev elt -- ... next )" } } { "result" "the final result" } } { $description "Combines successive elements of the list (in a right-assocative order) using a binary operation, and outputs the final result." } ; HELP: lmap -{ $values { "list" list } { "quot" { $quotation "( old -- new )" } } { "result" "the final result" } } +{ $values { "list" list } { "quot" { $quotation "( ... elt -- ... newelt )" } } { "result" "the final result" } } { $description "Applies the quotation to each element of the list in order, collecting the new elements into a new list." } ; HELP: lreverse diff --git a/basis/lists/lists.factor b/basis/lists/lists.factor index bef9261468..1e009df25c 100644 --- a/basis/lists/lists.factor +++ b/basis/lists/lists.factor @@ -61,10 +61,10 @@ PRIVATE> : lmap ( ... list quot: ( ... elt -- ... newelt ) -- ... result ) over nil? [ drop ] [ (leach) lmap cons ] if ; inline recursive -: foldl ( ... list identity quot: ( ... obj1 obj2 -- ... obj ) -- ... result ) +: foldl ( ... list identity quot: ( ... prev elt -- ... next ) -- ... result ) swapd leach ; inline -:: foldr ( ... list identity quot: ( ... obj1 obj2 -- ... obj ) -- ... result ) +:: foldr ( ... list identity quot: ( ... prev elt -- ... next ) -- ... result ) list nil? [ identity ] [ list cdr identity quot foldr list car quot call diff --git a/core/alien/alien-docs.factor b/core/alien/alien-docs.factor index 99f3a2b0f4..5f91d4c695 100644 --- a/core/alien/alien-docs.factor +++ b/core/alien/alien-docs.factor @@ -71,7 +71,7 @@ HELP: alien-invoke-error } ; HELP: alien-invoke -{ $values { "..." "zero or more objects passed to the C function" } { "return" "a C return type" } { "library" "a logical library name" } { "function" "a C function name" } { "parameters" "a sequence of C parameter types" } } +{ $values { "args..." "zero or more objects passed to the C function" } { "return" "a C return type" } { "library" "a logical library name" } { "function" "a C function name" } { "parameters" "a sequence of C parameter types" } { "return..." "the return value of the function, if not " { $link void } } } { $description "Calls a C library function with the given name. Input parameters are taken from the data stack, and the return value is pushed on the data stack after the function returns. A return type of " { $link void } " indicates that no value is to be expected." } { $notes "C type names are documented in " { $link "c-types-specs" } "." } { $errors "Throws an " { $link alien-invoke-error } " if the word calling " { $link alien-invoke } " was not compiled with the optimizing compiler." } ; @@ -85,7 +85,7 @@ HELP: alien-indirect-error } ; HELP: alien-indirect -{ $values { "..." "zero or more objects passed to the C function" } { "funcptr" "a C function pointer" } { "return" "a C return type" } { "parameters" "a sequence of C parameter types" } { "abi" "one of " { $snippet "\"cdecl\"" } " or " { $snippet "\"stdcall\"" } } } +{ $values { "args..." "zero or more objects passed to the C function" } { "funcptr" "a C function pointer" } { "return" "a C return type" } { "parameters" "a sequence of C parameter types" } { "abi" "one of " { $snippet "\"cdecl\"" } " or " { $snippet "\"stdcall\"" } } { "return..." "the return value of the function, if not " { $link void } } } { $description "Invokes a C function pointer passed on the data stack. Input parameters are taken from the data stack following the function pointer, and the return value is pushed on the data stack after the function returns. A return type of " { $link void } " indicates that no value is to be expected." } @@ -128,7 +128,7 @@ HELP: alien-assembly-error } ; HELP: alien-assembly -{ $values { "..." "zero or more objects passed to the C function" } { "return" "a C return type" } { "parameters" "a sequence of C parameter types" } { "abi" "one of " { $snippet "\"cdecl\"" } " or " { $snippet "\"stdcall\"" } } { "quot" quotation } } +{ $values { "args..." "zero or more objects passed to the C function" } { "return" "a C return type" } { "parameters" "a sequence of C parameter types" } { "abi" "one of " { $snippet "\"cdecl\"" } " or " { $snippet "\"stdcall\"" } } { "quot" quotation } { "return..." "the return value of the function, if not " { $link void } } } { $description "Invokes arbitrary machine code, generated at compile-time by the quotation. Input parameters are taken from the data stack, and the return value is pushed on the data stack after the function returns. A return type of " { $link void } " indicates that no value is to be expected." } diff --git a/core/alien/alien.factor b/core/alien/alien.factor index 3802147838..631fdcfc93 100644 --- a/core/alien/alien.factor +++ b/core/alien/alien.factor @@ -70,17 +70,17 @@ ERROR: alien-callback-error ; ERROR: alien-indirect-error ; -: alien-indirect ( ... funcptr return parameters abi -- ... ) +: alien-indirect ( args... funcptr return parameters abi -- return... ) alien-indirect-error ; ERROR: alien-invoke-error library symbol ; -: alien-invoke ( ... return library function parameters -- ... ) +: alien-invoke ( args... return library function parameters -- return... ) 2over alien-invoke-error ; ERROR: alien-assembly-error code ; -: alien-assembly ( ... return parameters abi quot -- ... ) +: alien-assembly ( args... return parameters abi quot -- return... ) dup alien-assembly-error ; ! Callbacks are registered in a global hashtable. Note that they diff --git a/core/classes/tuple/tuple-docs.factor b/core/classes/tuple/tuple-docs.factor index 7f6078e321..b3bdcb4673 100644 --- a/core/classes/tuple/tuple-docs.factor +++ b/core/classes/tuple/tuple-docs.factor @@ -421,8 +421,8 @@ HELP: ( layout -- tuple ) { $values { "layout" "a tuple layout array" } { "tuple" tuple } } { $description "Low-level tuple constructor. User code should never call this directly, and instead use " { $link new } "." } ; -HELP: ( ... layout -- tuple ) -{ $values { "..." "values" } { "layout" "a tuple layout array" } { "tuple" tuple } } +HELP: ( slots... layout -- tuple ) +{ $values { "slots..." "values" } { "layout" "a tuple layout array" } { "tuple" tuple } } { $description "Low-level tuple constructor. User code should never call this directly, and instead use " { $link boa } "." } ; HELP: new @@ -439,7 +439,7 @@ HELP: new } ; HELP: boa -{ $values { "..." "slot values" } { "class" tuple-class } { "tuple" tuple } } +{ $values { "slots..." "slot values" } { "class" tuple-class } { "tuple" tuple } } { $description "Creates a new instance of " { $snippet "class" } " and fill in the slots from the stack, with the top-most stack element being stored in the right-most slot." } { $notes "The name " { $snippet "boa" } " is shorthand for “by order of arguments”, and “BOA constructor” is a pun on “boa constrictor”." } { $errors "Throws an error if the slot values do not match class declarations on slots (see" { $link "tuple-declarations" } ")." } ; diff --git a/core/combinators/combinators-docs.factor b/core/combinators/combinators-docs.factor index 31183a629e..5b1ce8e80c 100644 --- a/core/combinators/combinators-docs.factor +++ b/core/combinators/combinators-docs.factor @@ -295,7 +295,7 @@ HELP: spread { bi* tri* spread } related-words HELP: to-fixed-point -{ $values { "object" object } { "quot" { $quotation "( object(n) -- object(n+1) )" } } { "object(n)" object } } +{ $values { "object" object } { "quot" { $quotation "( ... object(n) -- ... object(n+1) )" } } { "object(n)" object } } { $description "Applies the quotation repeatedly with " { $snippet "object" } " as the initial input until the output of the quotation equals the input." } { $examples { $example diff --git a/core/continuations/continuations-docs.factor b/core/continuations/continuations-docs.factor index 766a78c483..3710680269 100644 --- a/core/continuations/continuations-docs.factor +++ b/core/continuations/continuations-docs.factor @@ -182,7 +182,7 @@ HELP: cleanup { $description "Calls the " { $snippet "try" } " quotation. If no error is thrown, calls " { $snippet "cleanup-always" } " without restoring the data stack. If an error is thrown, restores the data stack, calls " { $snippet "cleanup-always" } " followed by " { $snippet "cleanup-error" } ", and rethrows the error." } ; HELP: recover -{ $values { "try" quotation } { "recovery" { $quotation "( error -- )" } } } +{ $values { "try" { $quotation "( ..a -- ..b )" } } { "recovery" { $quotation "( ..a error -- ..b )" } } } { $description "Calls the " { $snippet "try" } " quotation. If an exception is thrown in the dynamic extent of the " { $snippet "try" } " quotation, restores the data stack and calls the " { $snippet "recovery" } " quotation to handle the error." } ; HELP: ignore-errors diff --git a/core/kernel/kernel-docs.factor b/core/kernel/kernel-docs.factor index 8b9650fc31..8512700852 100644 --- a/core/kernel/kernel-docs.factor +++ b/core/kernel/kernel-docs.factor @@ -169,7 +169,7 @@ HELP: xor { $notes "This word implements boolean exclusive or, so applying it to integers will not yield useful results (all integers have a true value). Bitwise exclusive or is the " { $link bitxor } " word." } ; HELP: both? -{ $values { "x" object } { "y" object } { "quot" { $quotation "( obj -- ? )" } } { "?" "a boolean" } } +{ $values { "x" object } { "y" object } { "quot" { $quotation "( ... obj -- ... ? )" } } { "?" "a boolean" } } { $description "Tests if the quotation yields a true value when applied to both " { $snippet "x" } " and " { $snippet "y" } "." } { $examples { $example "USING: kernel math prettyprint ;" "3 5 [ odd? ] both? ." "t" } @@ -177,7 +177,7 @@ HELP: both? } ; HELP: either? -{ $values { "x" object } { "y" object } { "quot" { $quotation "( obj -- ? )" } } { "?" "a boolean" } } +{ $values { "x" object } { "y" object } { "quot" { $quotation "( ... obj -- ... ? )" } } { "?" "a boolean" } } { $description "Tests if the quotation yields a true value when applied to either " { $snippet "x" } " or " { $snippet "y" } "." } { $examples { $example "USING: kernel math prettyprint ;" "3 6 [ odd? ] either? ." "t" } @@ -214,22 +214,22 @@ HELP: call-clear ( quot -- * ) { $notes "Used to implement " { $link "threads" } "." } ; HELP: keep -{ $values { "x" object } { "quot" { $quotation "( x -- ... )" } } } +{ $values { "x" object } { "quot" { $quotation "( ..a x -- ..b )" } } } { $description "Call a quotation with a value on the stack, restoring the value when the quotation returns." } { $examples { $example "USING: arrays kernel prettyprint ;" "2 \"greetings\" [ ] keep 2array ." "{ { \"greetings\" \"greetings\" } \"greetings\" }" } } ; HELP: 2keep -{ $values { "x" object } { "y" object } { "quot" { $quotation "( x y -- ... )" } } } +{ $values { "x" object } { "y" object } { "quot" { $quotation "( ..a x y -- ..b )" } } } { $description "Call a quotation with two values on the stack, restoring the values when the quotation returns." } ; HELP: 3keep -{ $values { "x" object } { "y" object } { "z" object } { "quot" { $quotation "( x y z -- ... )" } } } +{ $values { "x" object } { "y" object } { "z" object } { "quot" { $quotation "( ..a x y z -- ..b )" } } } { $description "Call a quotation with three values on the stack, restoring the values when the quotation returns." } ; HELP: bi -{ $values { "x" object } { "p" { $quotation "( x -- ... )" } } { "q" { $quotation "( x -- ... )" } } } +{ $values { "x" object } { "p" { $quotation "( ..a x -- ..b )" } } { "q" { $quotation "( ..c x -- ..d )" } } } { $description "Applies " { $snippet "p" } " to " { $snippet "x" } ", then applies " { $snippet "q" } " to " { $snippet "x" } "." } { $examples "If " { $snippet "[ p ]" } " and " { $snippet "[ q ]" } " have stack effect " { $snippet "( x -- )" } ", then the following two lines are equivalent:" @@ -595,7 +595,7 @@ $nl "The " { $snippet "cond" } " value is removed from the stack before the quotation is called." } ; HELP: if* -{ $values { "?" "a generalized boolean" } { "true" { $quotation "( cond -- ... )" } } { "false" quotation } } +{ $values { "?" "a generalized boolean" } { "true" { $quotation "( ..a ? -- ..b )" } } { "false" { $quotation "( ..a -- ..b )" } } } { $description "Alternative conditional form that preserves the " { $snippet "cond" } " value if it is true." $nl "If the condition is true, it is retained on the stack before the " { $snippet "true" } " quotation is called. Otherwise, the condition is removed from the stack and the " { $snippet "false" } " quotation is called." @@ -618,7 +618,7 @@ HELP: unless* { $code "X [ Y ] unless*" "X dup [ ] [ drop Y ] if" } } ; HELP: ?if -{ $values { "default" object } { "cond" "a generalized boolean" } { "true" { $quotation "( cond -- ... )" } } { "false" { $quotation "( default -- ... )" } } } +{ $values { "default" object } { "cond" "a generalized boolean" } { "true" { $quotation "( ..a cond -- ..b )" } } { "false" { $quotation "( ..a default -- ..b )" } } } { $description "If the condition is " { $link f } ", the " { $snippet "false" } " quotation is called with the " { $snippet "default" } " value on the stack. Otherwise, the " { $snippet "true" } " quotation is called with the condition on the stack." } { $notes "The following two lines are equivalent:" @@ -771,15 +771,15 @@ HELP: 4dip } ; HELP: while -{ $values { "pred" { $quotation "( -- ? )" } } { "body" "a quotation" } } +{ $values { "pred" { $quotation "( ..a -- ..b ? )" } } { "body" { $quotation "( ..b -- ..a )" } } } { $description "Calls " { $snippet "body" } " until " { $snippet "pred" } " returns " { $link f } "." } ; HELP: until -{ $values { "pred" { $quotation "( -- ? )" } } { "body" "a quotation" } } +{ $values { "pred" { $quotation "( ..a -- ..b ? )" } } { "body" { $quotation "( ..b -- ..a )" } } } { $description "Calls " { $snippet "body" } " until " { $snippet "pred" } " returns " { $link t } "." } ; HELP: do -{ $values { "pred" { $quotation "( -- ? )" } } { "body" "a quotation" } } +{ $values { "pred" { $quotation "( ..a -- ..b ? )" } } { "body" { $quotation "( ..b -- ..a )" } } } { $description "Executes one iteration of a " { $link while } " or " { $link until } " loop." } ; HELP: loop diff --git a/core/kernel/kernel.factor b/core/kernel/kernel.factor index 3a53eb91e2..e506b7fc27 100644 --- a/core/kernel/kernel.factor +++ b/core/kernel/kernel.factor @@ -226,7 +226,7 @@ M: callstack clone (clone) ; inline ! Tuple construction GENERIC: new ( class -- tuple ) -GENERIC: boa ( ... class -- tuple ) +GENERIC: boa ( slots... class -- tuple ) ! Error handling -- defined early so that other files can ! throw errors before continuations are loaded diff --git a/core/lexer/lexer-docs.factor b/core/lexer/lexer-docs.factor index 04985a4340..3dc534cdfd 100644 --- a/core/lexer/lexer-docs.factor +++ b/core/lexer/lexer-docs.factor @@ -67,13 +67,13 @@ HELP: still-parsing? { $description "Outputs " { $link f } " if end of input has been reached, " { $link t } " otherwise." } ; HELP: each-token -{ $values { "end" string } { "quot" { $quotation "( token -- )" } } } +{ $values { "end" string } { "quot" { $quotation "( ... token -- ... )" } } } { $description "Reads a sequence of tokens until the first occurrence of " { $snippet "end" } ". " { $snippet "quot" } " is called on each token as it is read." } { $examples "This word is used to implement " { $link POSTPONE: USING: } "." } $parsing-note ; HELP: map-tokens -{ $values { "end" string } { "quot" { $quotation "( token -- object )" } } { "seq" "a new sequence of " { $snippet "object" } "s" } } +{ $values { "end" string } { "quot" { $quotation "( ... token -- ... elt )" } } { "seq" "a new sequence of " { $snippet "object" } "s" } } { $description "Reads a sequence of tokens until the first occurrence of " { $snippet "end" } ". " { $snippet "quot" } " is called on each token as it is read, and the results are collected into a new output sequence." } $parsing-note ; diff --git a/core/math/math-docs.factor b/core/math/math-docs.factor index 50a31434f4..1de443b0c5 100644 --- a/core/math/math-docs.factor +++ b/core/math/math-docs.factor @@ -410,22 +410,22 @@ HELP: power-of-2? { $description "Tests if " { $snippet "n" } " is a power of 2." } ; HELP: each-integer -{ $values { "n" integer } { "quot" { $quotation "( i -- )" } } } +{ $values { "n" integer } { "quot" { $quotation "( ... i -- ... )" } } } { $description "Applies the quotation to each integer from 0 up to " { $snippet "n" } ", excluding " { $snippet "n" } "." } { $notes "This word is used to implement " { $link each } "." } ; HELP: all-integers? -{ $values { "n" integer } { "quot" { $quotation "( i -- ? )" } } { "?" "a boolean" } } +{ $values { "n" integer } { "quot" { $quotation "( ... i -- ... ? )" } } { "?" "a boolean" } } { $description "Applies the quotation to each integer from 0 up to " { $snippet "n" } ", excluding " { $snippet "n" } ". Iteration stops when the quotation outputs " { $link f } " or the end is reached. If the quotation yields a false value for some integer, this word outputs " { $link f } ". Otherwise, this word outputs " { $link t } "." } { $notes "This word is used to implement " { $link all? } "." } ; HELP: find-integer -{ $values { "n" integer } { "quot" { $quotation "( i -- ? )" } } { "i" "an integer or " { $link f } } } +{ $values { "n" integer } { "quot" { $quotation "( ... i -- ... ? )" } } { "i" "an integer or " { $link f } } } { $description "Applies the quotation to each integer from 0 up to " { $snippet "n" } ", excluding " { $snippet "n" } ". Iterationi stops when the quotation outputs a true value or the end is reached. If the quotation yields a true value for some integer, this word outputs that integer. Otherwise, this word outputs " { $link f } "." } { $notes "This word is used to implement " { $link find } "." } ; HELP: find-last-integer -{ $values { "n" integer } { "quot" { $quotation "( i -- ? )" } } { "i" "an integer or " { $link f } } } +{ $values { "n" integer } { "quot" { $quotation "( ... i -- ... ? )" } } { "i" "an integer or " { $link f } } } { $description "Applies the quotation to each integer from " { $snippet "n" } " down to 0, inclusive. Iteration stops when the quotation outputs a true value or 0 is reached. If the quotation yields a true value for some integer, the word outputs that integer. Otherwise, the word outputs " { $link f } "." } { $notes "This word is used to implement " { $link find-last } "." } ; diff --git a/extra/gpu/buffers/buffers-docs.factor b/extra/gpu/buffers/buffers-docs.factor index 9ca1093000..cb1031c7fa 100644 --- a/extra/gpu/buffers/buffers-docs.factor +++ b/extra/gpu/buffers/buffers-docs.factor @@ -203,7 +203,7 @@ HELP: vertex-buffer HELP: with-mapped-buffer { $values - { "buffer" buffer } { "access" buffer-access-mode } { "quot" { $quotation "( alien -- )" } } + { "buffer" buffer } { "access" buffer-access-mode } { "quot" { $quotation "( ..a alien -- ..b )" } } } { $description "Maps " { $snippet "buffer" } " into CPU address space with " { $snippet "access" } " for the dynamic extent of " { $snippet "quot" } ". " { $snippet "quot" } " is called with a pointer to the mapped memory on top of the stack." } ; -- 2.34.1