]> gitweb.factorcode.org Git - factor.git/commitdiff
docs: using $maybe.
authorJohn Benediktsson <mrjbq7@gmail.com>
Sat, 12 Dec 2015 01:05:45 +0000 (17:05 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sat, 12 Dec 2015 01:05:45 +0000 (17:05 -0800)
basis/alien/libraries/finder/finder-docs.factor
basis/alien/syntax/syntax-docs.factor
basis/compiler/cfg/builder/blocks/blocks-docs.factor
basis/compiler/cfg/intrinsics/slots/slots-docs.factor
basis/db/tuples/tuples-docs.factor
basis/debugger/debugger-docs.factor
core/io/encodings/encodings-docs.factor
extra/id3/id3-docs.factor

index 598fd3d214bbf7eb07e5c61773f441b9cfa61747..9052a0a975976cd599ba214b46f211e414d0f37d 100644 (file)
@@ -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."
index 6bbd1a52bfc08a06c037118f1589c49267119d7b..4253507f64a93d0a94df8c18b952afdd1fc4d47e 100644 (file)
@@ -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 "<type>" } " 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:"
index 2d8b6b34f57337d87e422b1637831204e5319639..089bcaccf25ba39c6b80155d574d8aa0eb040072 100644 (file)
@@ -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." } ;
index c5ab3e25ef6bc12be5f683529412be2d9cce5864..bbacb0ea45b6f1fa6d8d5edfda4b20ba04df56b5 100644 (file)
@@ -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
index 9006e0cc1cf430289e891c19a9b94aabe0d64e58..f8b05954f471e43208e5d8ac60e8510aeee7a5f2 100644 (file)
@@ -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
index bccb38f97e5b54b7f276bfdd6be60eeabff94b4f..995cab178df65566fef812bb67b3c91c61010f7f 100644 (file)
@@ -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
index b78f7f9b5c5caca82784637b2cb8d507a1513bb5..ddcf2f37fb9219062e4ca1860da47d308c58a5dc 100644 (file)
@@ -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: <encoder>
@@ -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." } ;
 
index b9aff1a19e947e080dab6e39e39020c3c6c6b3ed..0c5ee143cfafe4ed1265177600b22ff653d0d932 100644 (file)
@@ -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 } "." } ;