help-lint fixes for recent changes

db4
Doug Coleman 2011-12-07 12:26:35 -08:00
parent 47fc91e948
commit abc953ecea
6 changed files with 22 additions and 39 deletions

View File

@ -1,13 +1,13 @@
! Copyright (C) 2009 Doug Coleman. ! Copyright (C) 2009 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: classes.tuple help.markup help.syntax kernel math USING: classes.tuple help.markup help.syntax kernel math
quotations sequences stack-checker ; quotations sequences stack-checker arrays ;
IN: combinators.smart IN: combinators.smart
HELP: input<sequence HELP: input<sequence
{ $values { $values
{ "seq" sequence }
{ "quot" quotation } { "quot" quotation }
{ "newquot" quotation }
} }
{ $description "Infers the number of inputs, " { $snippet "n" } ", to " { $snippet "quot" } " and calls the " { $snippet "quot" } " with the first " { $snippet "n" } " values from a sequence." } { $description "Infers the number of inputs, " { $snippet "n" } ", to " { $snippet "quot" } " and calls the " { $snippet "quot" } " with the first " { $snippet "n" } " values from a sequence." }
{ $examples { $examples
@ -21,7 +21,7 @@ HELP: input<sequence
HELP: output>array HELP: output>array
{ $values { $values
{ "quot" quotation } { "quot" quotation }
{ "newquot" quotation } { "array" array }
} }
{ $description "Infers the number of outputs from the quotation and constructs an array from those outputs." } { $description "Infers the number of outputs from the quotation and constructs an array from those outputs." }
{ $examples { $examples
@ -37,7 +37,7 @@ HELP: output>array
HELP: output>sequence HELP: output>sequence
{ $values { $values
{ "quot" quotation } { "exemplar" "an exemplar" } { "quot" quotation } { "exemplar" "an exemplar" }
{ "newquot" quotation } { "seq" sequence }
} }
{ $description "Infers the number of outputs from the quotation and constructs a new sequence from those objects of the same type as the exemplar." } { $description "Infers the number of outputs from the quotation and constructs a new sequence from those objects of the same type as the exemplar." }
{ $examples { $examples
@ -51,7 +51,6 @@ HELP: output>sequence
HELP: reduce-outputs HELP: reduce-outputs
{ $values { $values
{ "quot" quotation } { "operation" quotation } { "quot" quotation } { "operation" quotation }
{ "newquot" quotation }
} }
{ $description "Infers the number of outputs from " { $snippet "quot" } " and reduces them using " { $snippet "operation" } ". The identity for the " { $link reduce } " operation is the first output." } { $description "Infers the number of outputs from " { $snippet "quot" } " and reduces them using " { $snippet "operation" } ". The identity for the " { $link reduce } " operation is the first output." }
{ $examples { $examples
@ -119,7 +118,7 @@ HELP: keep-inputs
HELP: dropping HELP: dropping
{ $values { $values
{ "quot" quotation } { "quot" quotation }
{ "quot" quotation } { "quot'" quotation }
} }
{ $description "Outputs a quotation that, when called, will have the effect of dropping the number of inputs to the original quotation." } { $description "Outputs a quotation that, when called, will have the effect of dropping the number of inputs to the original quotation." }
{ $examples { $examples
@ -132,7 +131,7 @@ HELP: dropping
HELP: input<sequence-unsafe HELP: input<sequence-unsafe
{ $values { $values
{ "quot" quotation } { "seq" sequence }
{ "quot" quotation } { "quot" quotation }
} }
{ $description "An unsafe version of " { $link input<sequence-unsafe } "." } ; { $description "An unsafe version of " { $link input<sequence-unsafe } "." } ;
@ -140,7 +139,6 @@ HELP: input<sequence-unsafe
HELP: map-reduce-outputs HELP: map-reduce-outputs
{ $values { $values
{ "quot" quotation } { "mapper" quotation } { "reducer" quotation } { "quot" quotation } { "mapper" quotation } { "reducer" quotation }
{ "quot" quotation }
} }
{ $description "Infers the number of outputs from " { $snippet "quot" } " and, treating those outputs as a sequence, calls " { $link map-reduce } " on them." } { $description "Infers the number of outputs from " { $snippet "quot" } " and, treating those outputs as a sequence, calls " { $link map-reduce } " on them." }
{ $examples { $examples
@ -154,7 +152,6 @@ HELP: map-reduce-outputs
HELP: nullary HELP: nullary
{ $values { $values
{ "quot" quotation } { "quot" quotation }
{ "quot" quotation }
} }
{ $description "Infers the number of inputs to a quotation and drops them from the stack." } { $description "Infers the number of inputs to a quotation and drops them from the stack." }
{ $examples { $examples
@ -167,7 +164,6 @@ HELP: nullary
HELP: preserving HELP: preserving
{ $values { $values
{ "quot" quotation } { "quot" quotation }
{ "quot" quotation }
} }
{ $description "Calls a quotation and leaves any consumed inputs on the stack beneath the quotation's outputs." } { $description "Calls a quotation and leaves any consumed inputs on the stack beneath the quotation's outputs." }
{ $examples { $examples
@ -183,7 +179,6 @@ HELP: preserving
HELP: smart-apply HELP: smart-apply
{ $values { $values
{ "quot" quotation } { "n" integer } { "quot" quotation } { "n" integer }
{ "quot" quotation }
} }
{ $description "Applies a quotation to the datastack " { $snippet "n" } " times, starting lower on the stack and working up in increments of the number of inferred inputs to the quotation." } { $description "Applies a quotation to the datastack " { $snippet "n" } " times, starting lower on the stack and working up in increments of the number of inferred inputs to the quotation." }
{ $examples { $examples
@ -198,42 +193,36 @@ HELP: smart-apply
HELP: smart-if HELP: smart-if
{ $values { $values
{ "pred" quotation } { "true" quotation } { "false" quotation } { "pred" quotation } { "true" quotation } { "false" quotation }
{ "quot" quotation }
} }
{ $description "A version of " { $link if } " that takes three quotations, where the first quotation is a predicate that preserves any inputs it consumes." } ; { $description "A version of " { $link if } " that takes three quotations, where the first quotation is a predicate that preserves any inputs it consumes." } ;
HELP: smart-if* HELP: smart-if*
{ $values { $values
{ "pred" quotation } { "true" quotation } { "false" quotation } { "pred" quotation } { "true" quotation } { "false" quotation }
{ "quot" quotation }
} }
{ $description "A version of " { $link if } " that takes three quotations, where the first quotation is a predicate that preserves any inputs it consumes, the second is the " { $snippet "true" } " branch, and the third is the " { $snippet "false" } " branch. If the " { $snippet "true" } " branch is taken, the values are left on the stack and the quotation is called. If the " { $snippet "false" } " branch is taken, the number of inputs inferred from predicate quotation is dropped and the quotation is called." } ; { $description "A version of " { $link if } " that takes three quotations, where the first quotation is a predicate that preserves any inputs it consumes, the second is the " { $snippet "true" } " branch, and the third is the " { $snippet "false" } " branch. If the " { $snippet "true" } " branch is taken, the values are left on the stack and the quotation is called. If the " { $snippet "false" } " branch is taken, the number of inputs inferred from predicate quotation is dropped and the quotation is called." } ;
HELP: smart-unless HELP: smart-unless
{ $values { $values
{ "pred" quotation } { "false" quotation } { "pred" quotation } { "false" quotation }
{ "quot" quotation }
} }
{ $description "A version of " { $link unless } " that takes two quotations, where the first quotation is a predicate that preserves any inputs it consumes and the second is the " { $snippet "false" } " branch." } ; { $description "A version of " { $link unless } " that takes two quotations, where the first quotation is a predicate that preserves any inputs it consumes and the second is the " { $snippet "false" } " branch." } ;
HELP: smart-unless* HELP: smart-unless*
{ $values { $values
{ "pred" quotation } { "false" quotation } { "pred" quotation } { "false" quotation }
{ "quot" quotation }
} }
{ $description "A version of " { $link unless } " that takes two quotations, where the first quotation is a predicate that preserves any inputs it consumes and the second is the " { $snippet "false" } " branch. If the " { $snippet "true" } " branch is taken, the values are left on the stack. If the " { $snippet "false" } " branch is taken, the number of inputs inferred from predicate quotation is dropped and the quotation is called." } ; { $description "A version of " { $link unless } " that takes two quotations, where the first quotation is a predicate that preserves any inputs it consumes and the second is the " { $snippet "false" } " branch. If the " { $snippet "true" } " branch is taken, the values are left on the stack. If the " { $snippet "false" } " branch is taken, the number of inputs inferred from predicate quotation is dropped and the quotation is called." } ;
HELP: smart-when HELP: smart-when
{ $values { $values
{ "pred" quotation } { "true" quotation } { "pred" quotation } { "true" quotation }
{ "quot" quotation }
} }
{ $description "A version of " { $link when } " that takes two quotations, where the first quotation is a predicate that preserves any inputs it consumes and the second is the " { $snippet "true" } " branch." } ; { $description "A version of " { $link when } " that takes two quotations, where the first quotation is a predicate that preserves any inputs it consumes and the second is the " { $snippet "true" } " branch." } ;
HELP: smart-when* HELP: smart-when*
{ $values { $values
{ "pred" quotation } { "true" quotation } { "pred" quotation } { "true" quotation }
{ "quot" quotation }
} }
{ $description "A version of " { $link when } " that takes two quotations, where the first quotation is a predicate that preserves any inputs it consumes and the second is the " { $snippet "true" } " branch. If the " { $snippet "true" } " branch is taken, the values are left on the stack and the quotation is called. If the " { $snippet "false" } " branch is taken, the number of inputs inferred from predicate quotation is dropped." } ; { $description "A version of " { $link when } " that takes two quotations, where the first quotation is a predicate that preserves any inputs it consumes and the second is the " { $snippet "true" } " branch. If the " { $snippet "true" } " branch is taken, the values are left on the stack and the quotation is called. If the " { $snippet "false" } " branch is taken, the number of inputs inferred from predicate quotation is dropped." } ;

View File

@ -75,7 +75,7 @@ M: object infer-known* drop f ;
: reduce-outputs ( quot operation -- ) : reduce-outputs ( quot operation -- )
[ [ call ] [ [ drop ] compose outputs ] bi ] dip swap call-n ; inline [ [ call ] [ [ drop ] compose outputs ] bi ] dip swap call-n ; inline
: sum-outputs ( quot -- obj ) : sum-outputs ( quot -- n )
[ + ] reduce-outputs ; inline [ + ] reduce-outputs ; inline
: map-outputs ( quot mapper -- ) : map-outputs ( quot mapper -- )

View File

@ -157,7 +157,7 @@ HELP: nkeep
} ; } ;
HELP: ncurry HELP: ncurry
{ $values { "quot" quotation } { "n" integer } } { $values { "n" integer } }
{ $description "A generalization of " { $link curry } " that can work for any stack depth." { $description "A generalization of " { $link curry } " that can work for any stack depth."
} }
{ $examples { $examples
@ -170,7 +170,7 @@ HELP: ncurry
} ; } ;
HELP: nwith HELP: nwith
{ $values { "quot" quotation } { "n" integer } } { $values { "n" integer } }
{ $description "A generalization of " { $link with } " that can work for any stack depth." { $description "A generalization of " { $link with } " that can work for any stack depth."
} }
{ $examples { $examples

View File

@ -288,7 +288,6 @@ ARTICLE: "handbook-language-reference" "The language"
"locals" "locals"
"namespaces" "namespaces"
"namespaces-global" "namespaces-global"
"values"
} }
{ $heading "Abstractions" } { $heading "Abstractions" }
{ $subsections { $subsections

View File

@ -441,12 +441,7 @@ HELP: vshuffle
"int-4{ 0x11223344 0x11223344 0x11223344 0x11223344 }" "int-4{ 0x11223344 0x11223344 0x11223344 0x11223344 }"
"4 endian-swap vshuffle" "4 endian-swap vshuffle"
"16 number-base [ . ] with-variable" "16 number-base [ . ] with-variable"
"""int-4{ "int-4{ 0x44332211 0x44332211 0x44332211 0x44332211 }"
0x44332211
0x44332211
0x44332211
0x44332211
}"""
} }
} ; } ;

View File

@ -145,9 +145,9 @@ HELP: samples-per-second
HELP: samples>time HELP: samples>time
{ $values { $values
{ "samples" integer } { "samples" integer }
{ "time" duration } { "seconds" integer }
} }
{ $description "Converts a sample interval count to a " { $link duration } " based on the value of " { $link samples-per-second } "." } ; { $description "Converts a sample interval count to an integer based on the value of " { $link samples-per-second } "." } ;
HELP: top-down HELP: top-down
{ $values { $values