From f2721e0608798b9b2152ca2b2574c6c766f18ae5 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Thu, 11 Sep 2008 05:04:49 -0500 Subject: [PATCH] Help lint fixes --- .../tree/cleanup/cleanup-tests.factor | 19 +++++++++++++++++++ basis/math/functions/functions-docs.factor | 4 ++-- core/make/make-docs.factor | 2 +- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/basis/compiler/tree/cleanup/cleanup-tests.factor b/basis/compiler/tree/cleanup/cleanup-tests.factor index a761c8ec1e..15bc6444ac 100644 --- a/basis/compiler/tree/cleanup/cleanup-tests.factor +++ b/basis/compiler/tree/cleanup/cleanup-tests.factor @@ -478,3 +478,22 @@ cell-bits 32 = [ [ 2 swap >fixnum buffalo-wings ] { <-integer-fixnum +-integer-fixnum } inlined? ] unit-test + +! A reduction +: buffalo-sauce f ; + +: steak ( -- ) + buffalo-sauce [ steak ] when ; inline recursive + +: ribs ( i seq -- ) + 2dup < [ + steak + >r 1+ r> ribs + ] [ + 2drop + ] if ; inline recursive + +[ t ] [ + [ 2 swap >fixnum ribs ] + { <-integer-fixnum +-integer-fixnum } inlined? +] unit-test diff --git a/basis/math/functions/functions-docs.factor b/basis/math/functions/functions-docs.factor index bbfd8f41be..f9bb8e9897 100755 --- a/basis/math/functions/functions-docs.factor +++ b/basis/math/functions/functions-docs.factor @@ -282,8 +282,8 @@ HELP: each-bit { $values { "n" integer } { "quot" "a quotation with stack effect " { $snippet "( ? -- )" } } } { $description "Applies the quotation to each bit of the integer, starting from the least significant bit, and stopping at the last bit from which point on all bits are either clear (if the integer is positive) or all bits are set (if the integer is negataive)." } { $examples - { $example "USING: math.functions namespaces prettyprint ;" "[ BIN: 1101 [ , ] each-bit ] { } make ." "{ t f t t }" } - { $example "USING: math.functions namespaces prettyprint ;" "[ -3 [ , ] each-bit ] { } make ." "{ t f }" } + { $example "USING: math.functions make prettyprint ;" "[ BIN: 1101 [ , ] each-bit ] { } make ." "{ t f t t }" } + { $example "USING: math.functions make prettyprint ;" "[ -3 [ , ] each-bit ] { } make ." "{ t f }" } } ; HELP: ~ diff --git a/core/make/make-docs.factor b/core/make/make-docs.factor index ef037f1bb9..269f4fb26b 100644 --- a/core/make/make-docs.factor +++ b/core/make/make-docs.factor @@ -19,7 +19,7 @@ HELP: building HELP: make { $values { "quot" quotation } { "exemplar" sequence } { "seq" "a new sequence" } } { $description "Calls the quotation in a new " { $emphasis "dynamic scope" } ". The quotation and any words it calls can execute the " { $link , } " and " { $link % } " words to accumulate elements. When the quotation returns, all accumulated elements are collected into a sequence with the same type as " { $snippet "exemplar" } "." } -{ $examples { $example "USING: namespaces prettyprint ;" "[ 1 , 2 , 3 , ] { } make ." "{ 1 2 3 }" } } ; +{ $examples { $example "USING: make prettyprint ;" "[ 1 , 2 , 3 , ] { } make ." "{ 1 2 3 }" } } ; HELP: , { $values { "elt" object } }