From 3affad768185635880dc4e1c99fc0eb601d23a8e Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Fri, 11 Dec 2015 17:05:45 -0800 Subject: [PATCH] docs: using $maybe. --- basis/alien/libraries/finder/finder-docs.factor | 2 +- basis/alien/syntax/syntax-docs.factor | 2 +- .../cfg/builder/blocks/blocks-docs.factor | 2 +- .../cfg/intrinsics/slots/slots-docs.factor | 8 ++++---- basis/db/tuples/tuples-docs.factor | 2 +- basis/debugger/debugger-docs.factor | 2 +- core/io/encodings/encodings-docs.factor | 6 +++--- extra/id3/id3-docs.factor | 16 ++++++++-------- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/basis/alien/libraries/finder/finder-docs.factor b/basis/alien/libraries/finder/finder-docs.factor index 598fd3d214..9052a0a975 100644 --- a/basis/alien/libraries/finder/finder-docs.factor +++ b/basis/alien/libraries/finder/finder-docs.factor @@ -4,7 +4,7 @@ IN: alien.libraries.finder HELP: find-library* { $values { "name" "a shared library name" } - { "path/f" "a filesystem path or f" } + { "path/f" { $maybe "filesystem path" } } } { $description "Returns a filesystem path for a plain shared library name, or f if no library can be found." diff --git a/basis/alien/syntax/syntax-docs.factor b/basis/alien/syntax/syntax-docs.factor index 6bbd1a52bf..4253507f64 100644 --- a/basis/alien/syntax/syntax-docs.factor +++ b/basis/alien/syntax/syntax-docs.factor @@ -71,7 +71,7 @@ HELP: TYPEDEF: HELP: ENUM: { $syntax "ENUM: type words... ;" "ENUM: type < base-type words..." } -{ $values { "type" "a name to typedef to int or f" } { "words" "a sequence of word names" } } +{ $values { "type" { $maybe "a name to typedef to int" } } { "words" "a sequence of word names" } } { $description "Creates a c-type that boxes and unboxes integer values to symbols. A symbol is defined for each member word. The base c-type can optionally be specified and defaults to " { $link int } ". A constructor word " { $snippet "" } " is defined for converting from integers to singletons. The generic word " { $link enum>number } " converts from singletons to integers. Enum-typed values are automatically prettyprinted as their singleton words. Unrecognizing enum numbers are kept as numbers." } { $examples "Here is an example enumeration definition:" diff --git a/basis/compiler/cfg/builder/blocks/blocks-docs.factor b/basis/compiler/cfg/builder/blocks/blocks-docs.factor index 2d8b6b34f5..089bcaccf2 100644 --- a/basis/compiler/cfg/builder/blocks/blocks-docs.factor +++ b/basis/compiler/cfg/builder/blocks/blocks-docs.factor @@ -61,5 +61,5 @@ HELP: set-basic-block { $description "Sets the given blocks as the current one by storing it in the basic-block dynamic variable. If it has any " { $slot "instructions" } " the current " { $link building } " is set to those." } ; HELP: with-branch -{ $values { "quot" quotation } { "pair/f" "a pair or f" } } +{ $values { "quot" quotation } { "pair/f" { $maybe "pair" } } } { $description "The pair is either " { $link f } " or a two-tuple containing a " { $link basic-block } " and a " { $link height-state } " two-tuple." } ; diff --git a/basis/compiler/cfg/intrinsics/slots/slots-docs.factor b/basis/compiler/cfg/intrinsics/slots/slots-docs.factor index c5ab3e25ef..bbacb0ea45 100644 --- a/basis/compiler/cfg/intrinsics/slots/slots-docs.factor +++ b/basis/compiler/cfg/intrinsics/slots/slots-docs.factor @@ -4,7 +4,7 @@ math slots.private ; IN: compiler.cfg.intrinsics.slots HELP: class-tag -{ $values { "class" class } { "tag/f" "a number or f" } } +{ $values { "class" class } { "tag/f" { $maybe number } } } { $description "Finds the class number for this class if it is a subclass of a builtin class, or " { $link f } " if it isn't." } { $examples { $example @@ -15,7 +15,7 @@ HELP: class-tag } ; HELP: immediate-slot-offset? -{ $values { "object" object } { "?" "true or false" } } +{ $values { "object" object } { "?" boolean } } { $description { $link t } " if the object is a " { $link fixnum } " that is small enough to fit into a machine register. It is used to determine whether immediate versions of the instructions " { $link ##set-slot } " and " { $link ##set-slot-imm } " can be emitted." } { $examples @@ -30,12 +30,12 @@ HELP: node>set-slot-data { $values { "#call" #call } { "write-barrier?" "whether a write barrier is needed, it always is unless the item to set is an " { $link immediate } } - { "tag" "a number or f" } + { "tag" { $maybe number } } { "literal" "a literal" } } { $description "Grabs the data needed from a call node to determine what intrinsic CFG instructions to emit for the " { $link set-slot } " call." } ; HELP: value-tag -{ $values { "info" value-info-state } { "n/f" number } } +{ $values { "info" value-info-state } { "n/f" { $maybe number } } } { $description "Finds the class number for this value-info-states class (an index in the " { $link builtins } " list), or " { $link f } " if it hasn't one." } ; HELP: emit-set-slot diff --git a/basis/db/tuples/tuples-docs.factor b/basis/db/tuples/tuples-docs.factor index 9006e0cc1c..f8b05954f4 100644 --- a/basis/db/tuples/tuples-docs.factor +++ b/basis/db/tuples/tuples-docs.factor @@ -132,7 +132,7 @@ HELP: delete-tuples HELP: select-tuple { $values { "query/tuple" tuple } - { "tuple/f" "a tuple or f" } } + { "tuple/f" { $maybe tuple } } } { $description "A SQL query is constructed from the slots of the exemplar tuple that are not " { $link f } ". Returns a single tuple from the database if it matches the query constructed from the exemplar tuple." } ; HELP: select-tuples diff --git a/basis/debugger/debugger-docs.factor b/basis/debugger/debugger-docs.factor index bccb38f97e..995cab178d 100644 --- a/basis/debugger/debugger-docs.factor +++ b/basis/debugger/debugger-docs.factor @@ -47,7 +47,7 @@ HELP: :c { $description "Prints the call stack at the time of the most recent error. Used for interactive debugging." } ; HELP: :get -{ $values { "variable" object } { "value" "the value, or f" } } +{ $values { "variable" object } { "value" { $maybe "value" } } } { $description "Looks up the value of a variable at the time of the most recent error." } ; HELP: :res diff --git a/core/io/encodings/encodings-docs.factor b/core/io/encodings/encodings-docs.factor index b78f7f9b5c..ddcf2f37fb 100644 --- a/core/io/encodings/encodings-docs.factor +++ b/core/io/encodings/encodings-docs.factor @@ -1,4 +1,4 @@ -USING: help.markup help.syntax io quotations math sequences ; +USING: help.markup help.syntax io quotations math sequences strings ; IN: io.encodings HELP: @@ -26,8 +26,8 @@ HELP: decode-until { "seps" sequence } { "stream" "an input stream" } { "encoding" "an encoding descriptor" } - { "string/f" "a string or f" } - { "sep/f" "encountered separator or f" } + { "string/f" { $maybe string } } + { "sep/f" { $maybe "encountered separator" } } } { $description "Decodes characters from the stream until one of the separators are encountered." } ; diff --git a/extra/id3/id3-docs.factor b/extra/id3/id3-docs.factor index b9aff1a19e..0c5ee143cf 100644 --- a/extra/id3/id3-docs.factor +++ b/extra/id3/id3-docs.factor @@ -7,7 +7,7 @@ IN: id3 HELP: mp3>id3 { $values { "path" "a path string" } - { "id3/f" "a tuple storing ID3v2 metadata or f" } } + { "id3/f" { $maybe "tuple storing ID3v2 metadata" } } } { $description "Return a tuple containing the ID3 information parsed out of the MP3 file, or " { $link f } " if no metadata is present. Words to access the ID3v1 information are here:" { $list { $link title } @@ -23,49 +23,49 @@ HELP: mp3>id3 HELP: album { $values { "id3" id3 } - { "string/f" "string or f" } + { "string/f" { $maybe string } } } { $description "Returns the album, or " { $link f } " if this field is missing, from a parsed id3 tag." } ; HELP: artist { $values { "id3" id3 } - { "string/f" "string or f" } + { "string/f" { $maybe string } } } { $description "Returns the artist, or " { $link f } " if this field is missing, from a parsed id3 tag." } ; HELP: comment { $values { "id3" id3 } - { "string/f" "string or f" } + { "string/f" { $maybe string } } } { $description "Returns the comment, or " { $link f } " if this field is missing, from a parsed id3 tag." } ; HELP: genre { $values { "id3" id3 } - { "string/f" "string or f" } + { "string/f" { $maybe string } } } { $description "Returns the genre, or " { $link f } " if this field is missing, from a parsed id3 tag." } ; HELP: title { $values { "id3" id3 } - { "string/f" "string or f" } + { "string/f" { $maybe string } } } { $description "Returns the title, or " { $link f } " if this field is missing, from a parsed id3 tag." } ; HELP: year { $values { "id3" id3 } - { "string/f" "string or f" } + { "string/f" { $maybe string } } } { $description "Returns the year, or " { $link f } " if this field is missing, from a parsed id3 tag." } ; HELP: find-id3-frame { $values { "id3" id3 } { "name" string } - { "obj/f" "object or f" } + { "obj/f" { $maybe object } } } { $description "Returns the " { $slot "data" } " slot of the ID3 frame with the given name, or " { $link f } "." } ;