document number-base prettyprinter variable. add more docs about hex float syntax

Joe Groff 2009-09-18 15:11:01 -05:00
parent a5345c7cc3
commit 2050561915
4 changed files with 16 additions and 9 deletions

View File

@ -19,6 +19,9 @@ HELP: length-limit
HELP: line-limit HELP: line-limit
{ $var-description "The maximum number of lines output by the prettyprinter before output is truncated with \"...\". The default is " { $link f } ", denoting unlimited line count." } ; { $var-description "The maximum number of lines output by the prettyprinter before output is truncated with \"...\". The default is " { $link f } ", denoting unlimited line count." } ;
HELP: number-base
{ $var-description "The number base in which the prettyprinter will output numeric literals. A value of " { $snippet "2" } " will print integers and ratios in binary with " { $link POSTPONE: BIN: } ", and " { $snippet "8" } " will print them in octal with " { $link POSTPONE: OCT: } ". A value of " { $snippet "16" } " will print all integers, ratios, and floating-point values in hexadecimal with " { $link POSTPONE: HEX: } ". Other values of " { $snippet "number-base" } " will print numbers in decimal, which is the default." } ;
HELP: string-limit? HELP: string-limit?
{ $var-description "Toggles whether printed strings are truncated to the margin." } ; { $var-description "Toggles whether printed strings are truncated to the margin." } ;

View File

@ -28,6 +28,7 @@ ARTICLE: "prettyprint-variables" "Prettyprint control variables"
{ $subsection nesting-limit } { $subsection nesting-limit }
{ $subsection length-limit } { $subsection length-limit }
{ $subsection line-limit } { $subsection line-limit }
{ $subsection number-base }
{ $subsection string-limit? } { $subsection string-limit? }
{ $subsection boa-tuples? } { $subsection boa-tuples? }
{ $subsection c-object-pointers? } { $subsection c-object-pointers? }
@ -202,8 +203,8 @@ HELP: .o
{ $description "Outputs an integer in octal." } ; { $description "Outputs an integer in octal." } ;
HELP: .h HELP: .h
{ $values { "n" "an integer" } } { $values { "n" "an integer or floating-point value" } }
{ $description "Outputs an integer in hexadecimal." } ; { $description "Outputs an integer or floating-point value in hexadecimal." } ;
HELP: stack. HELP: stack.
{ $values { "seq" "a sequence" } } { $values { "seq" "a sequence" } }

View File

@ -61,7 +61,7 @@ HELP: bin>
$nl $nl
"Outputs " { $link f } " if the string does not represent a number." } ; "Outputs " { $link f } " if the string does not represent a number." } ;
{ bin> POSTPONE: BIN: bin> .b } related-words { >bin POSTPONE: BIN: bin> .b } related-words
HELP: oct> HELP: oct>
{ $values { "str" string } { "n/f" "a real number or " { $link f } } } { $values { "str" string } { "n/f" "a real number or " { $link f } } }
@ -69,7 +69,7 @@ HELP: oct>
$nl $nl
"Outputs " { $link f } " if the string does not represent a number." } ; "Outputs " { $link f } " if the string does not represent a number." } ;
{ oct> POSTPONE: OCT: oct> .o } related-words { >oct POSTPONE: OCT: oct> .o } related-words
HELP: hex> HELP: hex>
{ $values { "str" string } { "n/f" "a real number or " { $link f } } } { $values { "str" string } { "n/f" "a real number or " { $link f } } }
@ -77,7 +77,7 @@ HELP: hex>
$nl $nl
"Outputs " { $link f } " if the string does not represent a number." } ; "Outputs " { $link f } " if the string does not represent a number." } ;
{ hex> POSTPONE: HEX: hex> .h } related-words { >hex POSTPONE: HEX: hex> .h } related-words
HELP: >base HELP: >base
{ $values { "n" real } { "radix" "an integer between 2 and 36" } { "str" string } } { $values { "n" real } { "radix" "an integer between 2 and 36" } { "str" string } }

View File

@ -593,10 +593,13 @@ HELP: #!
{ $description "Discards all input until the end of the line." } ; { $description "Discards all input until the end of the line." } ;
HELP: HEX: HELP: HEX:
{ $syntax "HEX: integer" } { $syntax "HEX: NNN" "HEX: NNN.NNNpEEE" }
{ $values { "integer" "hexadecimal digits (0-9, a-f, A-F)" } } { $values { "N" "hexadecimal digit (0-9, a-f, A-F)" } { "pEEE" "decimal exponent value" } }
{ $description "Adds an integer read from a hexadecimal literal to the parse tree." } { $description "Adds an integer or floating-point value read from a hexadecimal literal to the parse tree." }
{ $examples { $example "USE: prettyprint" "HEX: ff ." "255" } } ; { $examples
{ $example "USE: prettyprint" "HEX: ff ." "255" }
{ $example "USE: prettyprint" "HEX: 1.8p5 ." "48.0" }
} ;
HELP: OCT: HELP: OCT:
{ $syntax "OCT: integer" } { $syntax "OCT: integer" }