From 8d2ceda8f3215d17d73a6e5a4d69675715db5eda Mon Sep 17 00:00:00 2001 From: Keita Haga Date: Mon, 17 Jan 2011 00:12:28 +0900 Subject: [PATCH] assocs, math.bitwise: remove first blank line and useless whitespace in a few usage examples --- basis/math/bitwise/bitwise-docs.factor | 20 ++++++++++---------- core/assocs/assocs-docs.factor | 10 +++++----- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/basis/math/bitwise/bitwise-docs.factor b/basis/math/bitwise/bitwise-docs.factor index 4024953070..34fa457c39 100644 --- a/basis/math/bitwise/bitwise-docs.factor +++ b/basis/math/bitwise/bitwise-docs.factor @@ -32,7 +32,7 @@ HELP: bitfield } } ; -HELP: bits +HELP: bits { $values { "m" integer } { "n" integer } { "m'" integer } } { $description "Keep only n bits from the integer m." } { $example "USING: math.bitwise prettyprint ;" "HEX: 123abcdef 16 bits .h" "cdef" } ; @@ -52,12 +52,12 @@ HELP: bit-clear? { "?" "a boolean" } } { $description "Returns " { $link t } " if the nth bit is set to zero." } -{ $examples +{ $examples { $example "USING: math.bitwise prettyprint ;" "HEX: ff 8 bit-clear? ." "t" } - { $example "" "USING: math.bitwise prettyprint ;" + { $example "USING: math.bitwise prettyprint ;" "HEX: ff 7 bit-clear? ." "f" } @@ -71,7 +71,7 @@ HELP: bit-count { "n" integer } } { $description "Returns the number of set bits as an object. This word only works on non-negative integers or objects that can be represented as a byte-array." } -{ $examples +{ $examples { $example "USING: math.bitwise prettyprint ;" "HEX: f0 bit-count ." "4" @@ -90,9 +90,9 @@ HELP: bitroll-32 { $values { "m" integer } { "s" integer } { "n" integer } -} +} { $description "Rolls the number " { $snippet "m" } " by " { $snippet "s" } " bits to the left, wrapping around after 32 bits." } -{ $examples +{ $examples { $example "USING: math.bitwise prettyprint ;" "HEX: 1 10 bitroll-32 .h" "400" @@ -109,7 +109,7 @@ HELP: bitroll-64 { "n" integer } } { $description "Rolls the number " { $snippet "m" } " by " { $snippet "s" } " bits to the left, wrapping around after 64 bits." } -{ $examples +{ $examples { $example "USING: math.bitwise prettyprint ;" "HEX: 1 10 bitroll-64 .h" "400" @@ -275,7 +275,7 @@ HELP: unmask { $description "Clears the bits in " { $snippet "x" } " if they are set in the mask " { $snippet "n" } "." } { $examples { $example "USING: math.bitwise kernel prettyprint ;" - "HEX: ff HEX: 0f unmask .h" + "HEX: ff HEX: 0f unmask .h" "f0" } } ; @@ -288,7 +288,7 @@ HELP: unmask? { $description "Tests whether unmasking the bits in " { $snippet "x" } " would return an integer greater than zero." } { $examples { $example "USING: math.bitwise kernel prettyprint ;" - "HEX: ff HEX: 0f unmask? ." + "HEX: ff HEX: 0f unmask? ." "t" } } ; @@ -339,7 +339,7 @@ HELP: wrap } { $description "Wraps an integer " { $snippet "m" } " by modding it by " { $snippet "n" } ". This word is uses bitwise arithmetic and does not actually call the modulus word, and as such can only mod by powers of two." } { $examples "Equivalent to modding by 8:" - { $example + { $example "USING: math.bitwise prettyprint ;" "HEX: ffff 8 wrap .h" "7" diff --git a/core/assocs/assocs-docs.factor b/core/assocs/assocs-docs.factor index 9fee74897c..a7982fff2d 100644 --- a/core/assocs/assocs-docs.factor +++ b/core/assocs/assocs-docs.factor @@ -369,7 +369,7 @@ HELP: assoc-union HELP: assoc-diff { $values { "assoc1" assoc } { "assoc2" assoc } { "diff" "a new assoc" } } -{ $description "Outputs an assoc consisting of all entries from " { $snippet "assoc1" } " whose key is not contained in " { $snippet "assoc2" } "." } +{ $description "Outputs an assoc consisting of all entries from " { $snippet "assoc1" } " whose key is not contained in " { $snippet "assoc2" } "." } ; HELP: assoc-diff! @@ -482,10 +482,10 @@ HELP: unzip { "assoc" assoc } { "keys" sequence } { "values" sequence } } { $description "Outputs an array of keys and an array of values of the input " { $snippet "assoc" } "." } -{ $examples +{ $examples { $example "USING: prettyprint assocs kernel ;" "{ { 1 4 } { 2 5 } { 3 6 } } unzip [ . ] bi@" - "{ 1 2 3 }\n{ 4 5 6 }" + "{ 1 2 3 }\n{ 4 5 6 }" } } ; @@ -494,8 +494,8 @@ HELP: zip { "keys" sequence } { "values" sequence } { "alist" "an array of key/value pairs" } } { $description "Combines two sequences pairwise into a single sequence of key/value pairs." } -{ $examples - { $example "" "USING: prettyprint assocs ;" +{ $examples + { $example "USING: prettyprint assocs ;" "{ 1 2 3 } { 4 5 6 } zip ." "{ { 1 4 } { 2 5 } { 3 6 } }" }