improve help by linking to types directly.
parent
74ede6e768
commit
57f9d78892
|
@ -1,44 +1,44 @@
|
|||
USING: help.markup help.syntax ;
|
||||
USING: help.markup help.syntax kernel strings ;
|
||||
IN: ascii
|
||||
|
||||
HELP: blank?
|
||||
{ $values { "ch" "a character" } { "?" "a boolean" } }
|
||||
{ $values { "ch" "a character" } { "?" boolean } }
|
||||
{ $description "Tests for an ASCII whitespace character." } ;
|
||||
|
||||
HELP: letter?
|
||||
{ $values { "ch" "a character" } { "?" "a boolean" } }
|
||||
{ $values { "ch" "a character" } { "?" boolean } }
|
||||
{ $description "Tests for a lowercase alphabet ASCII character." } ;
|
||||
|
||||
HELP: LETTER?
|
||||
{ $values { "ch" "a character" } { "?" "a boolean" } }
|
||||
{ $values { "ch" "a character" } { "?" boolean } }
|
||||
{ $description "Tests for a uppercase alphabet ASCII character." } ;
|
||||
|
||||
HELP: digit?
|
||||
{ $values { "ch" "a character" } { "?" "a boolean" } }
|
||||
{ $values { "ch" "a character" } { "?" boolean } }
|
||||
{ $description "Tests for an ASCII decimal digit character." } ;
|
||||
|
||||
HELP: Letter?
|
||||
{ $values { "ch" "a character" } { "?" "a boolean" } }
|
||||
{ $values { "ch" "a character" } { "?" boolean } }
|
||||
{ $description "Tests for an ASCII alphabet character, both upper and lower case." } ;
|
||||
|
||||
HELP: alpha?
|
||||
{ $values { "ch" "a character" } { "?" "a boolean" } }
|
||||
{ $values { "ch" "a character" } { "?" boolean } }
|
||||
{ $description "Tests for an alphanumeric ASCII character." } ;
|
||||
|
||||
HELP: printable?
|
||||
{ $values { "ch" "a character" } { "?" "a boolean" } }
|
||||
{ $values { "ch" "a character" } { "?" boolean } }
|
||||
{ $description "Tests for a printable ASCII character." } ;
|
||||
|
||||
HELP: control?
|
||||
{ $values { "ch" "a character" } { "?" "a boolean" } }
|
||||
{ $values { "ch" "a character" } { "?" boolean } }
|
||||
{ $description "Tests for an ASCII control character." } ;
|
||||
|
||||
HELP: quotable?
|
||||
{ $values { "ch" "a character" } { "?" "a boolean" } }
|
||||
{ $values { "ch" "a character" } { "?" boolean } }
|
||||
{ $description "Tests for characters which may appear in a Factor string literal without escaping." } ;
|
||||
|
||||
HELP: ascii?
|
||||
{ $values { "ch" "a character" } { "?" "a boolean" } }
|
||||
{ $values { "ch" "a character" } { "?" boolean } }
|
||||
{ $description "Tests for whether a number is an ASCII character." } ;
|
||||
|
||||
HELP: ch>lower
|
||||
|
@ -50,23 +50,23 @@ HELP: ch>upper
|
|||
{ $description "Converts an ASCII character to upper case." } ;
|
||||
|
||||
HELP: >lower
|
||||
{ $values { "str" "a string" } { "lower" "a string" } }
|
||||
{ $values { "str" string } { "lower" string } }
|
||||
{ $description "Converts an ASCII string to lower case." } ;
|
||||
|
||||
HELP: >upper
|
||||
{ $values { "str" "a string" } { "upper" "a string" } }
|
||||
{ $values { "str" string } { "upper" string } }
|
||||
{ $description "Converts an ASCII string to upper case." } ;
|
||||
|
||||
HELP: >title
|
||||
{ $values { "str" "a string" } { "title" "a string" } }
|
||||
{ $values { "str" string } { "title" string } }
|
||||
{ $description "Converts a string to title case." } ;
|
||||
|
||||
HELP: >words
|
||||
{ $values { "str" "a string" } { "words" "an array of slices" } }
|
||||
{ $values { "str" string } { "words" "an array of slices" } }
|
||||
{ $description "Divides the string up into words." } ;
|
||||
|
||||
HELP: capitalize
|
||||
{ $values { "str" "a string" } { "str'" "a string" } }
|
||||
{ $values { "str" string } { "str'" string } }
|
||||
{ $description "Capitalize all the words in a string." } ;
|
||||
|
||||
ARTICLE: "ascii" "ASCII"
|
||||
|
|
|
@ -34,13 +34,13 @@ HELP: sorted-index
|
|||
{ index index-from last-index last-index-from sorted-index } related-words
|
||||
|
||||
HELP: sorted-member?
|
||||
{ $values { "obj" object } { "seq" "a sorted sequence" } { "?" "a boolean" } }
|
||||
{ $values { "obj" object } { "seq" "a sorted sequence" } { "?" boolean } }
|
||||
{ $description "Tests if the sorted sequence contains " { $snippet "elt" } ". Equality is tested with " { $link = } "." } ;
|
||||
|
||||
{ member? sorted-member? } related-words
|
||||
|
||||
HELP: sorted-member-eq?
|
||||
{ $values { "obj" object } { "seq" "a sorted sequence" } { "?" "a boolean" } }
|
||||
{ $values { "obj" object } { "seq" "a sorted sequence" } { "?" boolean } }
|
||||
{ $description "Tests if the sorted sequence contains " { $snippet "elt" } ". Equality is tested with " { $link eq? } "." } ;
|
||||
|
||||
{ member-eq? sorted-member-eq? } related-words
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
USING: arrays help.markup help.syntax kernel
|
||||
kernel.private math prettyprint strings vectors sbufs ;
|
||||
USING: help.markup help.syntax math sequences ;
|
||||
IN: bit-arrays
|
||||
|
||||
ARTICLE: "bit-arrays" "Bit arrays"
|
||||
|
@ -48,7 +47,7 @@ HELP: <bit-array>
|
|||
{ $description "Creates a new bit array with the given length and all elements initially set to " { $link f } "." } ;
|
||||
|
||||
HELP: >bit-array
|
||||
{ $values { "seq" "a sequence" } { "bit-array" bit-array } }
|
||||
{ $values { "seq" sequence } { "bit-array" bit-array } }
|
||||
{ $description "Outputs a freshly-allocated bit array whose elements have the same boolean values as a given sequence." } ;
|
||||
|
||||
HELP: clear-bits
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
USING: arrays bit-arrays help.markup help.syntax kernel
|
||||
combinators ;
|
||||
USING: help.markup help.syntax sequences ;
|
||||
IN: bit-vectors
|
||||
|
||||
ARTICLE: "bit-vectors" "Bit vectors"
|
||||
|
@ -30,7 +29,7 @@ HELP: <bit-vector>
|
|||
{ $description "Creates a new bit vector that can hold " { $snippet "n" } " bits before resizing." } ;
|
||||
|
||||
HELP: >bit-vector
|
||||
{ $values { "seq" "a sequence" } { "vector" bit-vector } }
|
||||
{ $values { "seq" sequence } { "vector" bit-vector } }
|
||||
{ $description "Outputs a freshly-allocated bit vector with the same elements as a given sequence." } ;
|
||||
|
||||
HELP: ?V{
|
||||
|
|
|
@ -19,7 +19,7 @@ HELP: box>
|
|||
{ $errors "Throws an error if the box is empty." } ;
|
||||
|
||||
HELP: ?box
|
||||
{ $values { "box" box } { "value/f" "the value of the box or " { $link f } } { "?" "a boolean" } }
|
||||
{ $values { "box" box } { "value/f" "the value of the box or " { $link f } } { "?" boolean } }
|
||||
{ $description "If the box is full, removes the value from the box and pushes " { $link t } ". If the box is empty pushes " { $snippet "f f" } "." } ;
|
||||
|
||||
ARTICLE: "boxes" "Boxes"
|
||||
|
|
|
@ -175,7 +175,7 @@ HELP: nanoseconds
|
|||
{ years months days hours minutes seconds milliseconds microseconds nanoseconds } related-words
|
||||
|
||||
HELP: leap-year?
|
||||
{ $values { "obj" object } { "?" "a boolean" } }
|
||||
{ $values { "obj" object } { "?" boolean } }
|
||||
{ $description "Returns " { $link t } " if the object represents a leap year." }
|
||||
{ $examples
|
||||
{ $example "USING: calendar prettyprint ;"
|
||||
|
@ -357,7 +357,7 @@ HELP: <zero>
|
|||
{ $description "Returns a zero timestamp that consists of zeros for every slot. Used to see if timestamps are valid." } ;
|
||||
|
||||
HELP: valid-timestamp?
|
||||
{ $values { "timestamp" timestamp } { "?" "a boolean" } }
|
||||
{ $values { "timestamp" timestamp } { "?" boolean } }
|
||||
{ $description "Tests if a timestamp is valid or not." } ;
|
||||
|
||||
HELP: unix-1970
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
! Copyright (C) 2007 Chris Double.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: help.syntax help.markup ;
|
||||
USING: help.syntax help.markup kernel ;
|
||||
IN: channels
|
||||
|
||||
HELP: <channel>
|
||||
{ $values { "channel" "a channel object" }
|
||||
{ $values { "channel" channel }
|
||||
}
|
||||
{ $description "Create a channel that can be used for communicating between "
|
||||
"concurrent processes and threads. " { $link to } " and " { $link from }
|
||||
|
@ -15,8 +15,8 @@ HELP: <channel>
|
|||
{ $see-also from to } ;
|
||||
|
||||
HELP: to
|
||||
{ $values { "value" "an object" }
|
||||
{ "channel" "a channel object" }
|
||||
{ $values { "value" object }
|
||||
{ "channel" channel }
|
||||
}
|
||||
{ $description "Sends an object to a channel. The send operation is synchronous."
|
||||
" It will block the calling thread until there is a receiver waiting "
|
||||
|
@ -26,8 +26,8 @@ HELP: to
|
|||
{ $see-also <channel> from } ;
|
||||
|
||||
HELP: from
|
||||
{ $values { "channel" "a channel object" }
|
||||
{ "value" "an object" }
|
||||
{ $values { "channel" channel }
|
||||
{ "value" object }
|
||||
}
|
||||
{ $description "Receives an object from a channel. The operation is synchronous."
|
||||
" It will block the calling thread until there is data in the channel."
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2007 Chris Double.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: channels concurrency.distributed help.markup help.syntax
|
||||
io.servers ;
|
||||
io.servers strings ;
|
||||
IN: channels.remote
|
||||
|
||||
HELP: <remote-channel>
|
||||
|
@ -20,7 +20,7 @@ HELP: <remote-channel>
|
|||
{ $see-also publish unpublish } ;
|
||||
|
||||
HELP: unpublish
|
||||
{ $values { "id" "a string" }
|
||||
{ $values { "id" string }
|
||||
}
|
||||
{ $description "Stop a previously published channel from being "
|
||||
"accessible by remote nodes."
|
||||
|
@ -32,7 +32,7 @@ HELP: unpublish
|
|||
|
||||
HELP: publish
|
||||
{ $values { "channel" "a channel object" }
|
||||
{ "id" "a string" }
|
||||
{ "id" string }
|
||||
}
|
||||
{ $description "Make a channel accessible via remote Factor nodes. "
|
||||
"An id is returned that can be used by another node to use "
|
||||
|
|
|
@ -9,5 +9,5 @@ HELP: run-apple-script
|
|||
|
||||
HELP: APPLESCRIPT:
|
||||
{ $syntax "APPLESCRIPT: word ...applescript... ;APPLESCRIPT" }
|
||||
{ $values { "word" "a word" } { "...applescript..." "AppleScript source text" } }
|
||||
{ $values { "word" "a new word to define" } { "...applescript..." "AppleScript source text" } }
|
||||
{ $description "Defines a word that when called will run the provided uncompiled AppleScript. The word has stack effect " { $snippet "( -- )" } " due to return values being currently unsupported." } ;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
USING: help.markup help.syntax strings ;
|
||||
USING: help.markup help.syntax sequences strings ;
|
||||
IN: cocoa.nibs
|
||||
|
||||
HELP: load-nib
|
||||
|
@ -11,6 +11,6 @@ HELP: nib-named
|
|||
{ $see-also nib-objects } ;
|
||||
|
||||
HELP: nib-objects
|
||||
{ $values { "anNSNib" "an instance of NSNib" } { "objects/f" "a sequence" } }
|
||||
{ $values { "anNSNib" "an instance of NSNib" } { "objects/f" { $maybe sequence } } }
|
||||
{ $description "Instantiates the top-level objects of the " { $snippet ".nib" } " file loaded by anNSNib. First create an NSNib instance using " { $link nib-named } "." }
|
||||
{ $see-also nib-named } ;
|
|
@ -1,8 +1,8 @@
|
|||
USING: help.markup help.syntax strings ;
|
||||
USING: help.markup help.syntax kernel strings ;
|
||||
IN: cocoa.pasteboard
|
||||
|
||||
HELP: pasteboard-string?
|
||||
{ $values { "pasteboard" "an " { $snippet "NSPasteBoard" } } { "?" "a boolean" } }
|
||||
{ $values { "pasteboard" "an " { $snippet "NSPasteBoard" } } { "?" boolean } }
|
||||
{ $description "Tests if the pasteboard holds a string." } ;
|
||||
|
||||
HELP: pasteboard-string
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
USING: classes compiler.tree.propagation.info help.markup help.syntax math
|
||||
math.intervals ;
|
||||
USING: classes compiler.tree.propagation.info help.markup
|
||||
help.syntax kernel math math.intervals ;
|
||||
IN: compiler.tree.propagation.known-words
|
||||
|
||||
HELP: binary-op-class
|
||||
|
@ -27,7 +27,7 @@ HELP: number-valued
|
|||
{ $description "Ensure that the class is a subclass of " { $link number } "." } ;
|
||||
|
||||
HELP: fits-in-fixnum?
|
||||
{ $values { "interval" interval } { "?" "a boolean" } }
|
||||
{ $values { "interval" interval } { "?" boolean } }
|
||||
{ $description "Checks if the interval is a subset of the " { $link fixnum } " interval. Used to see if arithmetic may overflow." }
|
||||
{ $examples
|
||||
{ $example
|
||||
|
|
|
@ -7,7 +7,7 @@ HELP: <mailbox>
|
|||
|
||||
HELP: mailbox-empty?
|
||||
{ $values { "mailbox" mailbox }
|
||||
{ "bool" "a boolean" }
|
||||
{ "bool" boolean }
|
||||
}
|
||||
{ $description "Return true if the mailbox is empty." } ;
|
||||
|
||||
|
@ -20,14 +20,14 @@ HELP: mailbox-put
|
|||
HELP: block-unless-pred
|
||||
{ $values
|
||||
{ "mailbox" mailbox }
|
||||
{ "timeout" "a " { $link duration } " or " { $link f } }
|
||||
{ "timeout" { $maybe duration } }
|
||||
{ "pred" { $quotation ( ... message -- ... ? ) } }
|
||||
}
|
||||
{ $description "Block the thread if there are no items in the mailbox that return true when the predicate is called with the item on the stack." } ;
|
||||
|
||||
HELP: block-if-empty
|
||||
{ $values { "mailbox" mailbox }
|
||||
{ "timeout" "a " { $link duration } " or " { $link f } }
|
||||
{ "timeout" { $maybe duration } }
|
||||
}
|
||||
{ $description "Block the thread if the mailbox is empty." } ;
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
! Copyright (C) 2005, 2008 Chris Double, Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: concurrency.messaging kernel arrays
|
||||
continuations help.markup help.syntax quotations calendar ;
|
||||
USING: calendar help.markup help.syntax kernel ;
|
||||
IN: concurrency.promises
|
||||
|
||||
HELP: promise
|
||||
|
@ -12,7 +11,7 @@ HELP: <promise>
|
|||
{ $description "Creates a new promise which may be fulfilled by calling " { $link fulfill } "." } ;
|
||||
|
||||
HELP: promise-fulfilled?
|
||||
{ $values { "promise" promise } { "?" "a boolean" } }
|
||||
{ $values { "promise" promise } { "?" boolean } }
|
||||
{ $description "Tests if " { $link fulfill } " has previously been called on the promise, in which case " { $link ?promise } " will return immediately without blocking." } ;
|
||||
|
||||
HELP: ?promise-timeout
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
USING: assocs cpu.x86.assembler help.markup help.syntax literals math
|
||||
multiline system words ;
|
||||
USING: assocs cpu.x86.assembler help.markup help.syntax kernel
|
||||
literals math multiline system words ;
|
||||
IN: cpu.architecture
|
||||
|
||||
<<
|
||||
|
@ -27,7 +27,7 @@ HELP: signed-rep
|
|||
{ $description "Maps any representation to its signed counterpart, if it has one." } ;
|
||||
|
||||
HELP: immediate-arithmetic?
|
||||
{ $values { "n" number } { "?" "a boolean" } }
|
||||
{ $values { "n" number } { "?" boolean } }
|
||||
{ $description
|
||||
"Can this value be an immediate operand for " { $link %add-imm } ", "
|
||||
{ $link %sub-imm } ", or " { $link %mul-imm } "?"
|
||||
|
@ -42,7 +42,7 @@ HELP: vm-stack-space
|
|||
{ $description "Parameter space to reserve in anything making VM calls." } ;
|
||||
|
||||
HELP: complex-addressing?
|
||||
{ $values { "?" "a boolean" } }
|
||||
{ $values { "?" boolean } }
|
||||
{ $description "Specifies if " { $link %slot } ", " { $link %set-slot } " and " { $link %write-barrier } " accept the 'scale' and 'tag' parameters, and if %load-memory and %store-memory work." } ;
|
||||
|
||||
HELP: param-regs
|
||||
|
@ -63,7 +63,7 @@ HELP: %box-alien
|
|||
{ $examples { $unchecked-example $[ ex-%box-alien ] } } ;
|
||||
|
||||
HELP: fused-unboxing?
|
||||
{ $values { "?" "a boolean" } }
|
||||
{ $values { "?" boolean } }
|
||||
{ $description "Whether this architecture support " { $link %load-float } ", " { $link %load-double } ", and " { $link %load-vector } "." } ;
|
||||
|
||||
HELP: return-regs
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
USING: help.syntax help.markup kernel prettyprint sequences
|
||||
io.pathnames strings ;
|
||||
USING: help.markup help.syntax io.pathnames quotations strings ;
|
||||
IN: csv
|
||||
|
||||
HELP: read-row
|
||||
|
@ -48,7 +47,7 @@ HELP: write-csv
|
|||
|
||||
HELP: with-delimiter
|
||||
{ $values { "ch" "field delimiter (e.g. CHAR: \\t)" }
|
||||
{ "quot" "a quotation" } }
|
||||
{ "quot" quotation } }
|
||||
{ $description "Sets the field delimiter for read-csv, read-row, write-csv, or write-row words." } ;
|
||||
|
||||
ARTICLE: "csv" "Comma-separated-values parsing and writing"
|
||||
|
|
|
@ -107,7 +107,7 @@ HELP: advance-row
|
|||
{ $description "Advanced the pointer to an underlying SQL result set stored in a " { $link result-set } " object." } ;
|
||||
|
||||
HELP: more-rows?
|
||||
{ $values { "result-set" result-set } { "?" "a boolean" } }
|
||||
{ $values { "result-set" result-set } { "?" boolean } }
|
||||
{ $description "Returns true if the " { $link result-set } " has more rows to traverse." } ;
|
||||
|
||||
|
||||
|
@ -123,7 +123,7 @@ HELP: in-transaction
|
|||
|
||||
HELP: in-transaction?
|
||||
{ $values
|
||||
{ "?" "a boolean" } }
|
||||
{ "?" boolean } }
|
||||
{ $description "Returns true if there is currently a transaction in progress in this scope." } ;
|
||||
|
||||
HELP: query-each
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
! Copyright (C) 2008 Doug Coleman.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: classes hashtables help.markup help.syntax io.streams.string
|
||||
kernel sequences strings math ;
|
||||
USING: help.markup help.syntax kernel strings ;
|
||||
IN: db.types
|
||||
|
||||
HELP: +db-assigned-id+
|
||||
|
@ -90,7 +89,7 @@ HELP: VARCHAR
|
|||
HELP: user-assigned-id-spec?
|
||||
{ $values
|
||||
{ "specs" "a sequence of SQL specs" }
|
||||
{ "?" "a boolean" } }
|
||||
{ "?" boolean } }
|
||||
{ $description "Tests if any of the SQL specs has the type " { $link +user-assigned-id+ } "." } ;
|
||||
|
||||
HELP: bind#
|
||||
|
@ -106,7 +105,7 @@ HELP: bind%
|
|||
HELP: db-assigned-id-spec?
|
||||
{ $values
|
||||
{ "specs" "a sequence of SQL specs" }
|
||||
{ "?" "a boolean" } }
|
||||
{ "?" boolean } }
|
||||
{ $description "Tests if any of the SQL specs has the type " { $link +db-assigned-id+ } "." } ;
|
||||
|
||||
HELP: find-primary-key
|
||||
|
@ -129,13 +128,13 @@ HELP: normalize-spec
|
|||
HELP: primary-key?
|
||||
{ $values
|
||||
{ "spec" "a SQL spec" }
|
||||
{ "?" "a boolean" } }
|
||||
{ "?" boolean } }
|
||||
{ $description "Returns true if a SQL spec is a primary key." } ;
|
||||
|
||||
HELP: relation?
|
||||
{ $values
|
||||
{ "spec" "a SQL spec" }
|
||||
{ "?" "a boolean" } }
|
||||
{ "?" boolean } }
|
||||
{ $description "Returns true if a SQL spec is a relation." } ;
|
||||
|
||||
HELP: unknown-modifier
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
USING: alien arrays generic generic.math help.markup help.syntax
|
||||
kernel math memory strings sbufs vectors io io.files classes
|
||||
help generic.single continuations io.files.private listener
|
||||
alien.libraries ;
|
||||
USING: alien alien.libraries arrays continuations generic.math
|
||||
generic.single help help.markup help.syntax io kernel math
|
||||
quotations sbufs strings vectors ;
|
||||
IN: debugger
|
||||
|
||||
ARTICLE: "debugger" "The debugger"
|
||||
|
@ -48,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" "an object" } { "value" "the value, or f" } }
|
||||
{ $values { "variable" object } { "value" "the value, or f" } }
|
||||
{ $description "Looks up the value of a variable at the time of the most recent error." } ;
|
||||
|
||||
HELP: :res
|
||||
|
@ -84,7 +83,7 @@ HELP: restarts.
|
|||
{ $description "Print a list of restarts for the most recently thrown error to " { $link output-stream } "." } ;
|
||||
|
||||
HELP: try
|
||||
{ $values { "quot" "a quotation" } }
|
||||
{ $values { "quot" quotation } }
|
||||
{ $description "Attempts to call a quotation; if it throws an error, the error is printed to " { $link output-stream } ", stacks are restored, and execution continues after the call to " { $link try } "." }
|
||||
{ $examples
|
||||
"The following example prints an error and keeps going:"
|
||||
|
|
|
@ -3,7 +3,7 @@ quotations ;
|
|||
IN: deques
|
||||
|
||||
HELP: deque-empty?
|
||||
{ $values { "deque" deque } { "?" "a boolean" } }
|
||||
{ $values { "deque" deque } { "?" boolean } }
|
||||
{ $contract "Returns true if a deque is empty." }
|
||||
{ $notes "This operation is O(1)." } ;
|
||||
|
||||
|
@ -15,7 +15,7 @@ HELP: clear-deque
|
|||
HELP: deque-member?
|
||||
{ $values
|
||||
{ "value" object } { "deque" deque }
|
||||
{ "?" "a boolean" } }
|
||||
{ "?" boolean } }
|
||||
{ $description "Returns true if the " { $snippet "value" } " is found in the deque." } ;
|
||||
|
||||
HELP: push-front
|
||||
|
|
|
@ -14,7 +14,7 @@ HELP: equiv-set-size
|
|||
{ $description "Outputs the number of elements in the equivalence class of " { $snippet "a" } "." } ;
|
||||
|
||||
HELP: equiv?
|
||||
{ $values { "a" object } { "b" object } { "disjoint-set" disjoint-set } { "?" "a boolean" } }
|
||||
{ $values { "a" object } { "b" object } { "disjoint-set" disjoint-set } { "?" boolean } }
|
||||
{ $description "Tests if two elements belong to the same equivalence class." } ;
|
||||
|
||||
HELP: equate
|
||||
|
|
|
@ -40,7 +40,7 @@ HELP: <hashed-dlist>
|
|||
{ $description "Creates a new " { $link search-deque } " backed by a " { $link dlist } ", with a " { $link hashtable } " for fast membership tests." } ;
|
||||
|
||||
HELP: dlist-find
|
||||
{ $values { "dlist" { $link dlist } } { "quot" quotation } { "obj/f" "an object or " { $link f } } { "?" "a boolean" } }
|
||||
{ $values { "dlist" { $link dlist } } { "quot" quotation } { "obj/f" "an object or " { $link f } } { "?" boolean } }
|
||||
{ $description "Applies the quotation to each element of the " { $link dlist } " in turn, until it outputs a true value or the end of the " { $link dlist } " is reached. Outputs either the object it found or " { $link f } ", and a boolean which is true if an object is found." }
|
||||
{ $notes "Returns a boolean to allow dlists to store " { $link f } "."
|
||||
$nl
|
||||
|
@ -53,12 +53,12 @@ HELP: dlist-filter
|
|||
{ $side-effects { "dlist" } } ;
|
||||
|
||||
HELP: dlist-any?
|
||||
{ $values { "dlist" { $link dlist } } { "quot" quotation } { "?" "a boolean" } }
|
||||
{ $values { "dlist" { $link dlist } } { "quot" quotation } { "?" boolean } }
|
||||
{ $description "Just like " { $link dlist-find } " except it doesn't return the object." }
|
||||
{ $notes "This operation is O(n)." } ;
|
||||
|
||||
HELP: delete-node-if*
|
||||
{ $values { "dlist" { $link dlist } } { "quot" quotation } { "obj/f" "an object or " { $link f } } { "?" "a boolean" } }
|
||||
{ $values { "dlist" { $link dlist } } { "quot" quotation } { "obj/f" "an object or " { $link f } } { "?" boolean } }
|
||||
{ $description "Calls " { $link dlist-find } " on the " { $link dlist } " and deletes the node returned, if any. Returns the value of the deleted node and a boolean to allow the deleted value to distinguished from " { $link f } ", for nothing deleted." }
|
||||
{ $notes "This operation is O(n)." } ;
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
USING: help.markup help.syntax math models strings sequences ;
|
||||
USING: help.markup help.syntax kernel math models sequences
|
||||
strings ;
|
||||
IN: documents
|
||||
|
||||
HELP: +col
|
||||
|
@ -20,7 +21,7 @@ HELP: =line
|
|||
{ $description "Sets the line number of a line/column pair." } ;
|
||||
|
||||
HELP: lines-equal?
|
||||
{ $values { "loc1" "a pair of integers" } { "loc2" "a pair of integers" } { "?" "a boolean" } }
|
||||
{ $values { "loc1" "a pair of integers" } { "loc2" "a pair of integers" } { "?" boolean } }
|
||||
{ $description "Tests if both line/column pairs have the same line number." } ;
|
||||
|
||||
HELP: document
|
||||
|
|
|
@ -36,7 +36,7 @@ HELP: encode-password
|
|||
HELP: have-capabilities?
|
||||
{ $values
|
||||
{ "capabilities" "a sequence of capabilities" }
|
||||
{ "?" "a boolean" }
|
||||
{ "?" boolean }
|
||||
}
|
||||
{ $description "Tests if the currently logged-in user possesses the given capabilities." } ;
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ HELP: allow-deactivation
|
|||
{ $description "Adds a " { $snippet "deactivate-user" } " action to an authentication realm." } ;
|
||||
|
||||
HELP: allow-deactivation?
|
||||
{ $values { "?" "a boolean" } }
|
||||
{ $values { "?" boolean } }
|
||||
{ $description "Outputs true if the current authentication realm allows user profile deactivation." } ;
|
||||
|
||||
ARTICLE: "furnace.auth.features.deactivate-user" "User profile deactivation"
|
||||
|
|
|
@ -6,7 +6,7 @@ HELP: allow-edit-profile
|
|||
{ $description "Adds an " { $snippet "edit-profile" } " action to an authentication realm." } ;
|
||||
|
||||
HELP: allow-edit-profile?
|
||||
{ $values { "?" "a boolean" } }
|
||||
{ $values { "?" boolean } }
|
||||
{ $description "Outputs true if the current authentication realm allows user profile editing." } ;
|
||||
|
||||
ARTICLE: "furnace.auth.features.edit-profile" "User profile editing"
|
||||
|
|
|
@ -6,7 +6,7 @@ HELP: allow-password-recovery
|
|||
{ $description "Adds a " { $snippet "recover-password" } " action to an authentication realm." } ;
|
||||
|
||||
HELP: allow-password-recovery?
|
||||
{ $values { "?" "a boolean" } }
|
||||
{ $values { "?" boolean } }
|
||||
{ $description "Outputs true if the current authentication realm allows user password recovery." } ;
|
||||
|
||||
HELP: lost-password-from
|
||||
|
|
|
@ -6,7 +6,7 @@ HELP: allow-registration
|
|||
{ $description "Adds a " { $snippet "registration" } " action to an authentication realm." } ;
|
||||
|
||||
HELP: allow-registration?
|
||||
{ $values { "?" "a boolean" } }
|
||||
{ $values { "?" boolean } }
|
||||
{ $description "Outputs true if the current authentication realm allows user registration." } ;
|
||||
|
||||
ARTICLE: "furnace.auth.features.registration" "User registration"
|
||||
|
|
|
@ -72,7 +72,7 @@ HELP: resolve-template-path
|
|||
{ $description "Resolves a responder-relative template path." } ;
|
||||
|
||||
HELP: same-host?
|
||||
{ $values { "url" url } { "?" "a boolean" } }
|
||||
{ $values { "url" url } { "?" boolean } }
|
||||
{ $description "Tests if the given URL is located on the same host as the URL of the current request." } ;
|
||||
|
||||
HELP: user-agent
|
||||
|
|
|
@ -47,7 +47,7 @@ HELP: close-game-input
|
|||
{ $description "Closes the game input interface, releasing any allocated resources. Once this word is called, any remaining " { $link controller } " objects are invalid." } ;
|
||||
|
||||
HELP: game-input-opened?
|
||||
{ $values { "?" "a boolean" } }
|
||||
{ $values { "?" boolean } }
|
||||
{ $description "Returns true if the game input interface is open, false otherwise." } ;
|
||||
|
||||
HELP: with-game-input
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
USING: help.markup help.syntax sequences strings ;
|
||||
USING: help.markup help.syntax kernel sequences strings ;
|
||||
IN: grouping
|
||||
|
||||
ARTICLE: "grouping" "Groups and clumps"
|
||||
|
@ -65,7 +65,7 @@ $nl
|
|||
"New groups are created by calling " { $link <groups> } "." } ;
|
||||
|
||||
HELP: group
|
||||
{ $values { "seq" "a sequence" } { "n" "a non-negative integer" } { "array" "a sequence of sequences" } }
|
||||
{ $values { "seq" sequence } { "n" "a non-negative integer" } { "array" "a sequence of sequences" } }
|
||||
{ $description "Splits the sequence into disjoint groups of " { $snippet "n" } " elements and collects the groups into a new array." }
|
||||
{ $notes "If the sequence length is not a multiple of " { $snippet "n" } ", the final subsequence in the list will be shorter than " { $snippet "n" } " elements." }
|
||||
{ $examples
|
||||
|
@ -73,7 +73,7 @@ HELP: group
|
|||
} ;
|
||||
|
||||
HELP: <groups>
|
||||
{ $values { "seq" "a sequence" } { "n" "a non-negative integer" } { "groups" groups } }
|
||||
{ $values { "seq" sequence } { "n" "a non-negative integer" } { "groups" groups } }
|
||||
{ $description "Outputs a virtual sequence whose elements are slices of disjoint subsequences of " { $snippet "n" } " elements from the underlying sequence." }
|
||||
{ $examples
|
||||
{ $example
|
||||
|
@ -100,7 +100,7 @@ $nl
|
|||
"New clumps are created by calling " { $link <circular-clumps> } "." } ;
|
||||
|
||||
HELP: clump
|
||||
{ $values { "seq" "a sequence" } { "n" "a non-negative integer" } { "array" "a sequence of sequences" } }
|
||||
{ $values { "seq" sequence } { "n" "a non-negative integer" } { "array" "a sequence of sequences" } }
|
||||
{ $description "Splits the sequence into overlapping clumps of " { $snippet "n" } " elements and collects the clumps into a new array." }
|
||||
{ $notes "For an empty sequence, the result is an empty sequence. For a non empty sequence with a length smaller than " { $snippet "n" } ", the result will be an empty sequence." }
|
||||
{ $examples
|
||||
|
@ -108,7 +108,7 @@ HELP: clump
|
|||
} ;
|
||||
|
||||
HELP: circular-clump
|
||||
{ $values { "seq" "a sequence" } { "n" "a non-negative integer" } { "array" "a sequence of sequences" } }
|
||||
{ $values { "seq" sequence } { "n" "a non-negative integer" } { "array" "a sequence of sequences" } }
|
||||
{ $description "Splits the sequence into overlapping clumps of " { $snippet "n" } " elements, wrapping around the end of the sequence, and collects the clumps into a new array." }
|
||||
{ $notes "For an empty sequence, the result is an empty sequence." }
|
||||
{ $examples
|
||||
|
@ -116,7 +116,7 @@ HELP: circular-clump
|
|||
} ;
|
||||
|
||||
HELP: <clumps>
|
||||
{ $values { "seq" "a sequence" } { "n" "a non-negative integer" } { "clumps" clumps } }
|
||||
{ $values { "seq" sequence } { "n" "a non-negative integer" } { "clumps" clumps } }
|
||||
{ $description "Outputs a virtual sequence whose elements are overlapping subsequences of " { $snippet "n" } " elements from the underlying sequence." }
|
||||
{ $examples
|
||||
"Running averages:"
|
||||
|
@ -136,7 +136,7 @@ HELP: <clumps>
|
|||
} ;
|
||||
|
||||
HELP: <circular-clumps>
|
||||
{ $values { "seq" "a sequence" } { "n" "a non-negative integer" } { "clumps" clumps } }
|
||||
{ $values { "seq" sequence } { "n" "a non-negative integer" } { "clumps" clumps } }
|
||||
{ $description "Outputs a virtual sequence whose elements are overlapping slices of " { $snippet "n" } " elements from the underlying sequence, starting with each of its elements and wrapping around the end of the sequence." }
|
||||
{ $examples
|
||||
{ $example
|
||||
|
@ -153,7 +153,7 @@ HELP: <circular-clumps>
|
|||
{ <clumps> <circular-clumps> <groups> } related-words
|
||||
|
||||
HELP: monotonic?
|
||||
{ $values { "seq" sequence } { "quot" { $quotation ( elt1 elt2 -- ? ) } } { "?" "a boolean" } }
|
||||
{ $values { "seq" sequence } { "quot" { $quotation ( elt1 elt2 -- ? ) } } { "?" boolean } }
|
||||
{ $description "Applies the relation to successive pairs of elements in the sequence, testing for a truth value. The relation should be a transitive relation, such as a total order or an equality relation." }
|
||||
{ $examples
|
||||
"Testing if a sequence is non-decreasing:"
|
||||
|
@ -163,11 +163,11 @@ HELP: monotonic?
|
|||
} ;
|
||||
|
||||
HELP: all-equal?
|
||||
{ $values { "seq" sequence } { "?" "a boolean" } }
|
||||
{ $values { "seq" sequence } { "?" boolean } }
|
||||
{ $description "Tests if all elements in the sequence are equal. Yields true with an empty sequence." } ;
|
||||
|
||||
HELP: all-eq?
|
||||
{ $values { "seq" sequence } { "?" "a boolean" } }
|
||||
{ $values { "seq" sequence } { "?" boolean } }
|
||||
{ $description "Tests if all elements in the sequence are the same identical object. Yields true with an empty sequence." } ;
|
||||
|
||||
{ monotonic? all-eq? all-equal? } related-words
|
||||
|
|
|
@ -53,49 +53,49 @@ HELP: <max-heap>
|
|||
{ $description "Create a new " { $link max-heap } "." } ;
|
||||
|
||||
HELP: heap-push
|
||||
{ $values { "value" object } { "key" "a comparable object" } { "heap" "a heap" } }
|
||||
{ $values { "value" object } { "key" "a comparable object" } { "heap" heap } }
|
||||
{ $description "Push a pair onto a heap. The key must be comparable with all other keys by the " { $link <=> } " generic word." }
|
||||
{ $side-effects "heap" } ;
|
||||
|
||||
HELP: heap-push*
|
||||
{ $values { "value" object } { "key" "a comparable object" } { "heap" "a heap" } { "entry" entry } }
|
||||
{ $values { "value" object } { "key" "a comparable object" } { "heap" heap } { "entry" entry } }
|
||||
{ $description "Push a pair onto a heap, and output an entry which may later be passed to " { $link heap-delete } "." }
|
||||
{ $side-effects "heap" } ;
|
||||
|
||||
HELP: heap-push-all
|
||||
{ $values { "assoc" assoc } { "heap" "a heap" } }
|
||||
{ $values { "assoc" assoc } { "heap" heap } }
|
||||
{ $description "Push every key/value pair of an assoc onto a heap." }
|
||||
{ $side-effects "heap" } ;
|
||||
|
||||
HELP: heap-peek
|
||||
{ $values { "heap" "a heap" } { "value" object } { "key" object } }
|
||||
{ $values { "heap" heap } { "value" object } { "key" object } }
|
||||
{ $description "Output the first element in the heap, leaving it in the heap." } ;
|
||||
|
||||
HELP: heap-pop*
|
||||
{ $values { "heap" "a heap" } }
|
||||
{ $values { "heap" heap } }
|
||||
{ $description "Remove the first element from the heap." }
|
||||
{ $side-effects "heap" } ;
|
||||
|
||||
HELP: heap-pop
|
||||
{ $values { "heap" "a heap" } { "value" object } { "key" object } }
|
||||
{ $values { "heap" heap } { "value" object } { "key" object } }
|
||||
{ $description "Output and remove the first element in the heap." }
|
||||
{ $side-effects "heap" } ;
|
||||
|
||||
HELP: heap-empty?
|
||||
{ $values { "heap" "a heap" } { "?" "a boolean" } }
|
||||
{ $values { "heap" heap } { "?" boolean } }
|
||||
{ $description "Tests if a heap has no nodes." } ;
|
||||
|
||||
HELP: heap-size
|
||||
{ $values { "heap" "a heap" } { "n" integer } }
|
||||
{ $values { "heap" heap } { "n" integer } }
|
||||
{ $description "Returns the number of key/value pairs in the heap." } ;
|
||||
|
||||
HELP: heap-delete
|
||||
{ $values { "entry" entry } { "heap" "a heap" } }
|
||||
{ $values { "entry" entry } { "heap" heap } }
|
||||
{ $description "Remove the specified entry from the heap." }
|
||||
{ $errors "Throws an error if the entry is from another heap or if it has already been deleted." }
|
||||
{ $side-effects "heap" } ;
|
||||
|
||||
HELP: slurp-heap
|
||||
{ $values
|
||||
{ "heap" "a heap" } { "quot" quotation } }
|
||||
{ "heap" heap } { "quot" quotation } }
|
||||
{ $description "Removes values from a heap and processes them with the quotation until the heap is empty." } ;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
USING: help.markup help.crossref help.stylesheet help.topics
|
||||
help.syntax definitions io prettyprint summary arrays math
|
||||
sequences vocabs strings see ;
|
||||
USING: arrays help.crossref help.markup help.stylesheet
|
||||
help.syntax help.topics io kernel math prettyprint quotations
|
||||
see sequences strings summary vocabs ;
|
||||
IN: help
|
||||
|
||||
ARTICLE: "printing-elements" "Printing markup elements"
|
||||
|
@ -239,11 +239,11 @@ HELP: simple-element
|
|||
{ $class-description "Class of simple elements, which are just arrays of elements." } ;
|
||||
|
||||
HELP: ($span)
|
||||
{ $values { "quot" "a quotation" } }
|
||||
{ $values { "quot" quotation } }
|
||||
{ $description "Prints an inline markup element." } ;
|
||||
|
||||
HELP: ($block)
|
||||
{ $values { "quot" "a quotation" } }
|
||||
{ $values { "quot" quotation } }
|
||||
{ $description "Prints a block markup element with newlines before and after." } ;
|
||||
|
||||
HELP: $heading
|
||||
|
@ -340,7 +340,7 @@ HELP: $link
|
|||
} ;
|
||||
|
||||
HELP: textual-list
|
||||
{ $values { "seq" "a sequence" } { "quot" { $quotation ( elt -- ) } } }
|
||||
{ $values { "seq" sequence } { "quot" { $quotation ( elt -- ) } } }
|
||||
{ $description "Applies the quotation to each element of the sequence, printing a comma between each pair of elements." }
|
||||
{ $examples
|
||||
{ $example "USING: help.markup io namespaces ;" "last-element off" "{ \"fish\" \"chips\" \"salt\" } [ write ] textual-list" "fish, chips, salt" }
|
||||
|
@ -487,7 +487,7 @@ HELP: HELP:
|
|||
|
||||
HELP: ARTICLE:
|
||||
{ $syntax "ARTICLE: topic title content... ;" }
|
||||
{ $values { "topic" "an object" } { "title" "a string" } { "content" "markup elements" } }
|
||||
{ $values { "topic" object } { "title" string } { "content" "markup elements" } }
|
||||
{ $description "Defines a help article. String topic names are reserved for core documentation. Contributed modules should name articles by arrays, where the first element of an array identifies the module; for example, " { $snippet "{ \"httpd\" \"intro\" }" } "." }
|
||||
{ $examples
|
||||
{ $code
|
||||
|
|
|
@ -16,7 +16,7 @@ GENERIC: word-help* ( word -- content )
|
|||
] ?if ;
|
||||
|
||||
: $predicate ( element -- )
|
||||
{ { "object" object } { "?" "a boolean" } } $values
|
||||
{ { "object" object } { "?" boolean } } $values
|
||||
[
|
||||
"Tests if the object is an instance of the " ,
|
||||
first "predicating" word-prop <$link> ,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
USING: help.markup help.syntax help.crossref help io io.styles
|
||||
hashtables strings ;
|
||||
USING: help help.crossref help.markup help.syntax io.styles
|
||||
sequences strings words ;
|
||||
IN: help.topics
|
||||
|
||||
HELP: articles
|
||||
|
@ -23,11 +23,11 @@ HELP: article-content
|
|||
{ $description "Outputs the content of a specific help article." } ;
|
||||
|
||||
HELP: all-articles
|
||||
{ $values { "seq" "a sequence" } }
|
||||
{ $values { "seq" sequence } }
|
||||
{ $description "Outputs a sequence of all help article names, and all words with documentation." } ;
|
||||
|
||||
HELP: elements
|
||||
{ $values { "elt-type" "a word" } { "element" "a markup element" } { "seq" "a new sequence" } }
|
||||
{ $values { "elt-type" word } { "element" "a markup element" } { "seq" "a new sequence" } }
|
||||
{ $description "Outputs a sequence of all elements of type " { $snippet "elt-type" } " found by traversing " { $snippet "element" } "." } ;
|
||||
|
||||
HELP: collect-elements
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
USING: assocs help.markup help.syntax kernel quotations strings
|
||||
;
|
||||
IN: html.forms
|
||||
USING: help.markup help.syntax strings quotations kernel assocs ;
|
||||
|
||||
HELP: <form>
|
||||
{ $values { "form" form } }
|
||||
|
@ -78,7 +79,7 @@ HELP: with-each-object
|
|||
{ $notes "This word is used to implement the " { $snippet "t:bind-each" } " tag of the " { $vocab-link "html.templates.chloe" } " templating system. It can also be called directly from " { $vocab-link "html.templates.fhtml" } " templates." } ;
|
||||
|
||||
HELP: validation-failed?
|
||||
{ $values { "?" "a boolean" } }
|
||||
{ $values { "?" boolean } }
|
||||
{ $description "Tests if validation of the current form failed." } ;
|
||||
|
||||
HELP: validate-values
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
USING: help.markup help.syntax io.streams.string quotations strings urls
|
||||
http vocabs.refresh math io.servers assocs ;
|
||||
USING: assocs help.markup help.syntax http io.servers kernel
|
||||
math strings urls vocabs.refresh ;
|
||||
IN: http.server
|
||||
|
||||
HELP: trivial-responder
|
||||
|
@ -32,7 +32,7 @@ HELP: main-responder
|
|||
{ $var-description "The responder which will handle HTTP requests." } ;
|
||||
|
||||
HELP: post-request?
|
||||
{ $values { "?" "a boolean" } }
|
||||
{ $values { "?" boolean } }
|
||||
{ $description "Outputs if the current request is a POST request.s" } ;
|
||||
|
||||
HELP: responder-nesting
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
! Copyright (C) 2008, 2009 Daniel Ehrenberg.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: help.markup help.syntax assocs kernel sequences ;
|
||||
USING: assocs help.markup help.syntax kernel sequences ;
|
||||
IN: interval-maps
|
||||
|
||||
HELP: interval-at*
|
||||
|
@ -12,7 +12,7 @@ HELP: interval-at
|
|||
{ $description "Looks up a key in an interval map, returning the value of the corresponding interval, or f if the interval is not present in the map." } ;
|
||||
|
||||
HELP: interval-key?
|
||||
{ $values { "key" object } { "map" interval-map } { "?" "a boolean" } }
|
||||
{ $values { "key" object } { "map" interval-map } { "?" boolean } }
|
||||
{ $description "Tests whether an object is in an interval in the interval map, returning t if the object is present." } ;
|
||||
|
||||
HELP: <interval-map>
|
||||
|
|
|
@ -1,38 +1,38 @@
|
|||
USING: help.syntax help.markup ;
|
||||
USING: help.markup help.syntax kernel quotations words ;
|
||||
IN: inverse
|
||||
|
||||
HELP: [undo]
|
||||
{ $values { "quot" "a quotation" } { "undo" "the inverse of the quotation" } }
|
||||
{ $values { "quot" quotation } { "undo" "the inverse of the quotation" } }
|
||||
{ $description "Creates the inverse of the given quotation" }
|
||||
{ $see-also undo } ;
|
||||
|
||||
HELP: undo
|
||||
{ $values { "quot" "a quotation" } }
|
||||
{ $values { "quot" quotation } }
|
||||
{ $description "Executes the inverse of the given quotation" }
|
||||
{ $see-also [undo] } ;
|
||||
|
||||
HELP: define-inverse
|
||||
{ $values { "word" "a word" } { "quot" "the inverse" } }
|
||||
{ $values { "word" word } { "quot" "the inverse" } }
|
||||
{ $description "Defines the inverse of a given word, taking no arguments from the quotation, only the stack." }
|
||||
{ $see-also define-dual define-involution define-pop-inverse } ;
|
||||
|
||||
HELP: define-dual
|
||||
{ $values { "word1" "a word" } { "word2" "a word" } }
|
||||
{ $values { "word1" word } { "word2" word } }
|
||||
{ $description "Defines the inverse of each word as being the other one." }
|
||||
{ $see-also define-inverse define-involution } ;
|
||||
|
||||
HELP: define-involution
|
||||
{ $values { "word" "a word" } }
|
||||
{ $values { "word" word } }
|
||||
{ $description "Defines a word as being its own inverse." }
|
||||
{ $see-also define-dual define-inverse } ;
|
||||
|
||||
HELP: define-pop-inverse
|
||||
{ $values { "word" "a word" } { "n" "number of arguments to be taken from the inverted quotation" } { "quot" "a quotation" } }
|
||||
{ $values { "word" word } { "n" "number of arguments to be taken from the inverted quotation" } { "quot" quotation } }
|
||||
{ $description "Defines the inverse of the given word, taking the given number of arguments from the inverted quotation. The quotation given should generate an inverse quotation." }
|
||||
{ $see-also define-inverse } ;
|
||||
|
||||
HELP: matches?
|
||||
{ $values { "quot" "a quotation" } { "?" "a boolean" } }
|
||||
{ $values { "quot" quotation } { "?" boolean } }
|
||||
{ $description "Tests if the stack can match the given quotation. The quotation is inverted, and if the inverse can run without a unification failure, then t is returned. Else f is returned. If a different error is encountered (such as stack underflow), this will be propagated." } ;
|
||||
|
||||
HELP: switch
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
USING: help.markup help.syntax byte-arrays alien destructors ;
|
||||
USING: alien byte-arrays destructors help.markup help.syntax
|
||||
kernel ;
|
||||
IN: io.buffers
|
||||
|
||||
ARTICLE: "buffers" "Locked I/O buffers"
|
||||
|
@ -101,7 +102,7 @@ HELP: buffer-capacity
|
|||
} ;
|
||||
|
||||
HELP: buffer-empty?
|
||||
{ $values { "buffer" buffer } { "?" "a boolean" } }
|
||||
{ $values { "buffer" buffer } { "?" boolean } }
|
||||
{ $description "Tests if the buffer contains no more data to be read or written." } ;
|
||||
|
||||
HELP: >buffer
|
||||
|
|
|
@ -13,15 +13,15 @@ HELP: link-info
|
|||
{ file-info link-info } related-words
|
||||
|
||||
HELP: directory?
|
||||
{ $values { "file-info" file-info } { "?" "a boolean" } }
|
||||
{ $values { "file-info" file-info } { "?" boolean } }
|
||||
{ $description "Tests if " { $snippet "file-info" } " is a directory." } ;
|
||||
|
||||
HELP: regular-file?
|
||||
{ $values { "file-info" file-info } { "?" "a boolean" } }
|
||||
{ $values { "file-info" file-info } { "?" boolean } }
|
||||
{ $description "Tests if " { $snippet "file-info" } " is a normal file." } ;
|
||||
|
||||
HELP: symbolic-link?
|
||||
{ $values { "file-info" file-info } { "?" "a boolean" } }
|
||||
{ $values { "file-info" file-info } { "?" boolean } }
|
||||
{ $description "Tests if " { $snippet "file-info" } " is a symbolic link." } ;
|
||||
|
||||
HELP: file-systems
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2008 Doug Coleman.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: classes help.markup help.syntax io.streams.string
|
||||
strings math calendar io.files.info io.files.info.unix ;
|
||||
USING: calendar help.markup help.syntax io.files.info kernel
|
||||
math strings ;
|
||||
IN: io.files.info.unix
|
||||
|
||||
HELP: add-file-permissions
|
||||
|
@ -49,37 +49,37 @@ HELP: file-user-id
|
|||
HELP: group-execute?
|
||||
{ $values
|
||||
{ "obj" "a pathname string or an integer" }
|
||||
{ "?" "a boolean" } }
|
||||
{ "?" boolean } }
|
||||
{ $description "Tests whether the " { $snippet "group execute" } " bit is set on a file, " { $link file-info } ", or an integer." } ;
|
||||
|
||||
HELP: group-read?
|
||||
{ $values
|
||||
{ "obj" "a pathname string, file-info object, or an integer" }
|
||||
{ "?" "a boolean" } }
|
||||
{ "?" boolean } }
|
||||
{ $description "Tests whether the " { $snippet "group read" } " bit is set on a file, " { $link file-info } ", or an integer." } ;
|
||||
|
||||
HELP: group-write?
|
||||
{ $values
|
||||
{ "obj" "a pathname string, file-info object, or an integer" }
|
||||
{ "?" "a boolean" } }
|
||||
{ "?" boolean } }
|
||||
{ $description "Tests whether the " { $snippet "group write" } " bit is set on a file, " { $link file-info } ", or an integer." } ;
|
||||
|
||||
HELP: other-execute?
|
||||
{ $values
|
||||
{ "obj" "a pathname string, file-info object, or an integer" }
|
||||
{ "?" "a boolean" } }
|
||||
{ "?" boolean } }
|
||||
{ $description "Tests whether the " { $snippet "other execute" } " bit is set on a file, " { $link file-info } ", or an integer." } ;
|
||||
|
||||
HELP: other-read?
|
||||
{ $values
|
||||
{ "obj" "a pathname string, file-info object, or an integer" }
|
||||
{ "?" "a boolean" } }
|
||||
{ "?" boolean } }
|
||||
{ $description "Tests whether the " { $snippet "other read" } " bit is set on a file, " { $link file-info } ", or an integer." } ;
|
||||
|
||||
HELP: other-write?
|
||||
{ $values
|
||||
{ "obj" "a pathname string, file-info object, or an integer" }
|
||||
{ "?" "a boolean" } }
|
||||
{ "?" boolean } }
|
||||
{ $description "Tests whether the " { $snippet "other write" } " bit is set on a file, " { $link file-info } ", or an integer." } ;
|
||||
|
||||
HELP: set-file-access-time
|
||||
|
@ -130,98 +130,98 @@ HELP: set-file-modified-time
|
|||
|
||||
HELP: set-gid
|
||||
{ $values
|
||||
{ "path" "a pathname string" } { "?" "a boolean" } }
|
||||
{ "path" "a pathname string" } { "?" boolean } }
|
||||
{ $description "Sets the " { $snippet "gid" } " bit of a file to true or false." } ;
|
||||
|
||||
HELP: gid?
|
||||
{ $values
|
||||
{ "obj" "a pathname string, file-info object, or an integer" }
|
||||
{ "?" "a boolean" } }
|
||||
{ "?" boolean } }
|
||||
{ $description "Tests whether the " { $snippet "gid" } " bit is set on a file, " { $link file-info } ", or an integer." } ;
|
||||
|
||||
HELP: set-group-execute
|
||||
{ $values
|
||||
{ "path" "a pathname string" } { "?" "a boolean" } }
|
||||
{ "path" "a pathname string" } { "?" boolean } }
|
||||
{ $description "Sets the " { $snippet "group execute" } " bit of a file to true or false." } ;
|
||||
|
||||
HELP: set-group-read
|
||||
{ $values
|
||||
{ "path" "a pathname string" } { "?" "a boolean" } }
|
||||
{ "path" "a pathname string" } { "?" boolean } }
|
||||
{ $description "Sets the " { $snippet "group read" } " bit of a file to true or false." } ;
|
||||
|
||||
HELP: set-group-write
|
||||
{ $values
|
||||
{ "path" "a pathname string" } { "?" "a boolean" } }
|
||||
{ "path" "a pathname string" } { "?" boolean } }
|
||||
{ $description "Sets the " { $snippet "group write" } " bit of a file to true or false." } ;
|
||||
|
||||
HELP: set-other-execute
|
||||
{ $values
|
||||
{ "path" "a pathname string" } { "?" "a boolean" } }
|
||||
{ "path" "a pathname string" } { "?" boolean } }
|
||||
{ $description "Sets the " { $snippet "other execute" } " bit of a file to true or false." } ;
|
||||
|
||||
HELP: set-other-read
|
||||
{ $values
|
||||
{ "path" "a pathname string" } { "?" "a boolean" } }
|
||||
{ "path" "a pathname string" } { "?" boolean } }
|
||||
{ $description "Sets the " { $snippet "other read" } " bit of a file to true or false." } ;
|
||||
|
||||
HELP: set-other-write
|
||||
{ $values
|
||||
{ "path" "a pathname string" } { "?" "a boolean" } }
|
||||
{ "path" "a pathname string" } { "?" boolean } }
|
||||
{ $description "Sets the " { $snippet "other execute" } " bit of a file to true or false." } ;
|
||||
|
||||
HELP: set-sticky
|
||||
{ $values
|
||||
{ "path" "a pathname string" } { "?" "a boolean" } }
|
||||
{ "path" "a pathname string" } { "?" boolean } }
|
||||
{ $description "Sets the " { $snippet "sticky" } " bit of a file to true or false." } ;
|
||||
|
||||
HELP: sticky?
|
||||
{ $values
|
||||
{ "obj" "a pathname string, file-info object, or an integer" }
|
||||
{ "?" "a boolean" } }
|
||||
{ "?" boolean } }
|
||||
{ $description "Tests whether the " { $snippet "sticky" } " bit is set on a file, " { $link file-info } ", or an integer." } ;
|
||||
|
||||
HELP: set-uid
|
||||
{ $values
|
||||
{ "path" "a pathname string" } { "?" "a boolean" } }
|
||||
{ "path" "a pathname string" } { "?" boolean } }
|
||||
{ $description "Sets the " { $snippet "uid" } " bit of a file to true or false." } ;
|
||||
|
||||
HELP: uid?
|
||||
{ $values
|
||||
{ "obj" "a pathname string, file-info object, or an integer" }
|
||||
{ "?" "a boolean" } }
|
||||
{ "?" boolean } }
|
||||
{ $description "Tests whether the " { $snippet "uid" } " bit is set on a file, " { $link file-info } ", or an integer." } ;
|
||||
|
||||
HELP: set-user-execute
|
||||
{ $values
|
||||
{ "path" "a pathname string" } { "?" "a boolean" } }
|
||||
{ "path" "a pathname string" } { "?" boolean } }
|
||||
{ $description "Sets the " { $snippet "user execute" } " bit of a file to true or false." } ;
|
||||
|
||||
HELP: set-user-read
|
||||
{ $values
|
||||
{ "path" "a pathname string" } { "?" "a boolean" } }
|
||||
{ "path" "a pathname string" } { "?" boolean } }
|
||||
{ $description "Sets the " { $snippet "user read" } " bit of a file to true or false." } ;
|
||||
|
||||
HELP: set-user-write
|
||||
{ $values
|
||||
{ "path" "a pathname string" } { "?" "a boolean" } }
|
||||
{ "path" "a pathname string" } { "?" boolean } }
|
||||
{ $description "Sets the " { $snippet "user write" } " bit of a file to true or false." } ;
|
||||
|
||||
HELP: user-execute?
|
||||
{ $values
|
||||
{ "obj" "a pathname string, file-info object, or an integer" }
|
||||
{ "?" "a boolean" } }
|
||||
{ "?" boolean } }
|
||||
{ $description "Tests whether the " { $snippet "user execute" } " bit is set on a file, " { $link file-info } ", or an integer." } ;
|
||||
|
||||
HELP: user-read?
|
||||
{ $values
|
||||
{ "obj" "a pathname string, file-info object, or an integer" }
|
||||
{ "?" "a boolean" } }
|
||||
{ "?" boolean } }
|
||||
{ $description "Tests whether the " { $snippet "user read" } " bit is set on a file, " { $link file-info } ", or an integer." } ;
|
||||
|
||||
HELP: user-write?
|
||||
{ $values
|
||||
{ "obj" "a pathname string, file-info object, or an integer" }
|
||||
{ "?" "a boolean" } }
|
||||
{ "?" boolean } }
|
||||
{ $description "Tests whether the " { $snippet "user write" } " bit is set on a file, " { $link file-info } ", or an integer." } ;
|
||||
|
||||
ARTICLE: "unix-file-permissions" "Unix file permissions"
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
USING: help.markup help.syntax io io.ports kernel math
|
||||
io.pathnames io.directories math.parser io.files strings
|
||||
quotations io.files.unique.private ;
|
||||
USING: help.markup help.syntax quotations strings ;
|
||||
IN: io.files.unique
|
||||
|
||||
HELP: default-temporary-directory
|
||||
|
@ -24,7 +22,7 @@ HELP: unique-retries
|
|||
{ unique-length unique-retries } related-words
|
||||
|
||||
HELP: make-unique-file
|
||||
{ $values { "prefix" "a string" } { "suffix" "a string" }
|
||||
{ $values { "prefix" string } { "suffix" string }
|
||||
{ "path" "a pathname string" } }
|
||||
{ $description "Creates a file that is guaranteed not to exist in the directory stored in " { $link current-temporary-directory } ". The file name is composed of a prefix, a number of random digits and letters, and the suffix. Returns the full pathname." }
|
||||
{ $errors "Throws an error if a new unique file cannot be created after a number of tries. The most likely error is incorrect directory permissions on the temporary directory." } ;
|
||||
|
@ -32,8 +30,8 @@ HELP: make-unique-file
|
|||
{ unique-file make-unique-file cleanup-unique-file } related-words
|
||||
|
||||
HELP: cleanup-unique-file
|
||||
{ $values { "prefix" "a string" } { "suffix" "a string" }
|
||||
{ "quot" "a quotation" } }
|
||||
{ $values { "prefix" string } { "suffix" string }
|
||||
{ "quot" quotation } }
|
||||
{ $description "Creates a file with " { $link make-unique-file } " and calls the quotation with the path name on the stack." }
|
||||
{ $notes "The unique file will be deleted after calling this word." } ;
|
||||
|
||||
|
@ -43,7 +41,7 @@ HELP: unique-directory
|
|||
{ $errors "Throws an error if the directory cannot be created after a number of tries. The most likely error is incorrect directory permissions on the temporary directory." } ;
|
||||
|
||||
HELP: cleanup-unique-directory
|
||||
{ $values { "quot" "a quotation" } }
|
||||
{ $values { "quot" quotation } }
|
||||
{ $description "Creates a directory with " { $link unique-directory } " and calls the quotation with the pathname on the stack using the " { $link with-temporary-directory } " combinator. The quotation can access the " { $link current-temporary-directory } " symbol for the name of the temporary directory. Subsequent unique files will be created in this unique directory until the combinator returns." }
|
||||
{ $notes "The directory will be deleted after calling this word, even if an error is thrown in the quotation. This combinator is like " { $link with-unique-directory } " but does not delete the directory." } ;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
IN: io.monitors
|
||||
USING: help.markup help.syntax continuations destructors
|
||||
concurrency.mailboxes quotations ;
|
||||
USING: concurrency.mailboxes destructors help.markup help.syntax
|
||||
kernel quotations ;
|
||||
|
||||
HELP: with-monitors
|
||||
{ $values { "quot" quotation } }
|
||||
|
@ -8,12 +8,12 @@ HELP: with-monitors
|
|||
{ $errors "Throws an error if the platform does not support file system change monitors." } ;
|
||||
|
||||
HELP: <monitor>
|
||||
{ $values { "path" "a pathname string" } { "recursive?" "a boolean" } { "monitor" "a new monitor" } }
|
||||
{ $values { "path" "a pathname string" } { "recursive?" boolean } { "monitor" "a new monitor" } }
|
||||
{ $contract "Opens a file system change monitor which listens for changes on " { $snippet "path" } ". The boolean indicates whether changes in subdirectories should be reported." }
|
||||
{ $errors "Throws an error if the pathname does not exist, if a monitor could not be created or if the platform does not support monitors." } ;
|
||||
|
||||
HELP: (monitor)
|
||||
{ $values { "path" "a pathname string" } { "recursive?" "a boolean" } { "mailbox" mailbox } { "monitor" "a new monitor" } }
|
||||
{ $values { "path" "a pathname string" } { "recursive?" boolean } { "mailbox" mailbox } { "monitor" "a new monitor" } }
|
||||
{ $contract "Opens a file system change monitor which listens for changes on " { $snippet "path" } " and posts notifications to " { $snippet "mailbox" } " as triples with shape " { $snippet "{ path changed monitor } " } ". The boolean indicates whether changes in subdirectories should be reported." }
|
||||
{ $errors "Throws an error if the pathname does not exist, if a monitor could not be created or if the platform does not support monitors." } ;
|
||||
|
||||
|
@ -26,7 +26,7 @@ HELP: next-change
|
|||
{ $errors "Throws an error if the monitor is closed from another thread." } ;
|
||||
|
||||
HELP: with-monitor
|
||||
{ $values { "path" "a pathname string" } { "recursive?" "a boolean" } { "quot" { $quotation ( monitor -- ) } } }
|
||||
{ $values { "path" "a pathname string" } { "recursive?" boolean } { "quot" { $quotation ( monitor -- ) } } }
|
||||
{ $description "Opens a file system change monitor and passes it to the quotation. Closes the monitor after the quotation returns or throws an error." }
|
||||
{ $errors "Throws an error if the pathname does not exist, if a monitor could not be created or if the platform does not support monitors." } ;
|
||||
|
||||
|
|
|
@ -72,5 +72,5 @@ HELP: (wait-to-read)
|
|||
{ $contract "Suspends the current thread until the port's buffer has data available for reading." } ;
|
||||
|
||||
HELP: wait-to-read
|
||||
{ $values { "port" input-port } { "eof?" "a boolean" } }
|
||||
{ $values { "port" input-port } { "eof?" boolean } }
|
||||
{ $description "If the port's buffer has unread data, returns immediately, otherwise suspends the current thread until some data is available for reading. If the buffer was empty and no more data could be read, outputs " { $link t } " to indicate end-of-file; otherwise outputs " { $link f } "." } ;
|
||||
|
|
|
@ -158,7 +158,7 @@ ARTICLE: "table-styles" "Table styles"
|
|||
} ;
|
||||
|
||||
HELP: write-object
|
||||
{ $values { "str" string } { "obj" "an object" } }
|
||||
{ $values { "str" string } { "obj" object } }
|
||||
{ $description "Writes a string to " { $link output-stream } ", associating it with the object. If formatted output is supported, the string will become a clickable presentation of the object, otherwise this word behaves like a call to " { $link write } "." }
|
||||
$io-error ;
|
||||
|
||||
|
|
|
@ -4,12 +4,12 @@ USING: help.markup help.syntax ;
|
|||
IN: json.writer
|
||||
|
||||
HELP: >json
|
||||
{ $values { "obj" "an object" } { "string" "the object converted to JSON format" } }
|
||||
{ $values { "obj" object } { "string" "the object converted to JSON format" } }
|
||||
{ $description "Serializes the object into a JSON formatted string." }
|
||||
{ $see-also json-print } ;
|
||||
|
||||
HELP: json-print
|
||||
{ $values { "obj" "an object" } }
|
||||
{ $values { "obj" object } }
|
||||
{ $description "Serializes the object into a JSON formatted string and outputs it to the standard output stream.
|
||||
|
||||
By default, tuples and hashtables are serialized into Javascript-friendly JSON formatted output by converting keys containing dashes into underscores. This behaviour can be modified by setting the dynamic variable " { $strong "jsvar-encode?" } " to false." }
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
USING: help.syntax help.markup ;
|
||||
USING: help.syntax help.markup sequences ;
|
||||
IN: lcs
|
||||
|
||||
HELP: levenshtein
|
||||
{ $values { "old" "a sequence" } { "new" "a sequence" } { "n" "the Levenshtein distance" } }
|
||||
{ $values { "old" sequence } { "new" sequence } { "n" "the Levenshtein distance" } }
|
||||
{ $description "Calculates the Levenshtein distance between old and new, that is, the minimal number of changes from the old sequence to the new one, in terms of deleting, inserting and replacing characters." } ;
|
||||
|
||||
HELP: lcs
|
||||
{ $values { "seq1" "a sequence" } { "seq2" "a sequence" } { "lcs" "a longest common subsequence" } }
|
||||
{ $values { "seq1" sequence } { "seq2" sequence } { "lcs" "a longest common subsequence" } }
|
||||
{ $description "Given two sequences, calculates a longest common subsequence between them. Note two things: this is only one of the many possible LCSs, and the LCS may not be contiguous." } ;
|
||||
|
||||
HELP: diff
|
||||
{ $values { "old" "a sequence" } { "new" "a sequence" } { "diff" "an edit script" } }
|
||||
{ $values { "old" sequence } { "new" sequence } { "diff" "an edit script" } }
|
||||
{ $description "Given two sequences, find a minimal edit script from the old to the new. There may be more than one minimal edit script, and this chooses one arbitrarily. This script is in the form of an array of the tuples of the classes " { $link retain } ", " { $link delete } " and " { $link insert } " which have their information stored in the 'item' slot." } ;
|
||||
|
||||
HELP: retain
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
! Copyright (C) 2006 Chris Double.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: help.markup help.syntax sequences strings lists ;
|
||||
USING: help.markup help.syntax kernel lists math sequences
|
||||
strings ;
|
||||
IN: lists.lazy
|
||||
|
||||
ABOUT: "lists.lazy"
|
||||
|
@ -108,20 +109,20 @@ HELP: lappend
|
|||
{ $description "Perform a similar functionality to that of the " { $link append } " word, but in a lazy manner. No evaluation of the list elements occurs initially but a " { $link <lazy-append> } " object is returned which conforms to the list protocol. Calling " { $link car } ", " { $link cdr } " or " { $link nil? } " on this will evaluate elements as required. Successive calls to " { $link cdr } " will iterate through list1, followed by list2." } ;
|
||||
|
||||
HELP: lfrom-by
|
||||
{ $values { "n" "an integer" } { "quot" { $quotation ( n -- o ) } } { "lazy-from-by" "a lazy list of integers" } }
|
||||
{ $values { "n" integer } { "quot" { $quotation ( n -- o ) } } { "lazy-from-by" "a lazy list of integers" } }
|
||||
{ $description "Return an infinite lazy list of values starting from n, with each successive value being the result of applying quot to the previous value." } ;
|
||||
|
||||
HELP: lfrom
|
||||
{ $values { "n" "an integer" } { "list" "a lazy list of integers" } }
|
||||
{ $values { "n" integer } { "list" "a lazy list of integers" } }
|
||||
{ $description "Return an infinite lazy list of incrementing integers starting from n." } ;
|
||||
|
||||
HELP: sequence-tail>list
|
||||
{ $values { "index" "an integer 0 or greater" } { "seq" "a sequence" } { "list" "a list" } }
|
||||
{ $values { "index" "an integer 0 or greater" } { "seq" sequence } { "list" "a list" } }
|
||||
{ $description "Convert the sequence into a list, starting from " { $snippet "index" } "." }
|
||||
{ $see-also >list } ;
|
||||
|
||||
HELP: >list
|
||||
{ $values { "object" "an object" } { "list" "a list" } }
|
||||
{ $values { "object" object } { "list" "a list" } }
|
||||
{ $description "Convert the object into a list. Existing lists are passed through intact, sequences are converted using " { $link sequence-tail>list } " and other objects cause an error to be thrown." }
|
||||
{ $see-also sequence-tail>list } ;
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ HELP: nil
|
|||
{ $description "Returns a symbol representing the empty list" } ;
|
||||
|
||||
HELP: nil?
|
||||
{ $values { "object" object } { "?" "a boolean" } }
|
||||
{ $values { "object" object } { "?" boolean } }
|
||||
{ $description "Return true if the cons object is the nil cons." } ;
|
||||
|
||||
{ nil nil? } related-words
|
||||
|
@ -95,15 +95,15 @@ HELP: nil?
|
|||
{ 1list 2list 3list } related-words
|
||||
|
||||
HELP: 1list
|
||||
{ $values { "obj" "an object" } { "cons" list } }
|
||||
{ $values { "obj" object } { "cons" list } }
|
||||
{ $description "Create a list with 1 element." } ;
|
||||
|
||||
HELP: 2list
|
||||
{ $values { "a" "an object" } { "b" "an object" } { "cons" list } }
|
||||
{ $values { "a" object } { "b" object } { "cons" list } }
|
||||
{ $description "Create a list with 2 elements." } ;
|
||||
|
||||
HELP: 3list
|
||||
{ $values { "a" "an object" } { "b" "an object" } { "c" "an object" } { "cons" list } }
|
||||
{ $values { "a" object } { "b" object } { "c" object } { "cons" list } }
|
||||
{ $description "Create a list with 3 elements." } ;
|
||||
|
||||
HELP: lnth
|
||||
|
@ -131,11 +131,11 @@ HELP: leach
|
|||
{ $description "Call the quotation for each item in the list." } ;
|
||||
|
||||
HELP: foldl
|
||||
{ $values { "list" list } { "identity" "an object" } { "quot" { $quotation ( ... prev elt -- ... next ) } } { "result" "the final result" } }
|
||||
{ $values { "list" list } { "identity" object } { "quot" { $quotation ( ... prev elt -- ... next ) } } { "result" "the final result" } }
|
||||
{ $description "Combines successive elements of the list (in a left-associative order) using a binary operation and outputs the final result." } ;
|
||||
|
||||
HELP: foldr
|
||||
{ $values { "list" list } { "identity" "an object" } { "quot" { $quotation ( ... prev elt -- ... next ) } } { "result" "the final result" } }
|
||||
{ $values { "list" list } { "identity" object } { "quot" { $quotation ( ... prev elt -- ... next ) } } { "result" "the final result" } }
|
||||
{ $description "Combines successive elements of the list (in a right-associative order) using a binary operation, and outputs the final result." } ;
|
||||
|
||||
HELP: lmap
|
||||
|
|
|
@ -210,7 +210,7 @@ HELP: mask-bit
|
|||
HELP: mask?
|
||||
{ $values
|
||||
{ "x" integer } { "n" integer }
|
||||
{ "?" "a boolean" }
|
||||
{ "?" boolean }
|
||||
}
|
||||
{ $description "Returns true if all of the bits in the mask " { $snippet "n" } " are set in the integer input " { $snippet "x" } "." }
|
||||
{ $examples
|
||||
|
@ -310,7 +310,7 @@ HELP: unmask
|
|||
HELP: unmask?
|
||||
{ $values
|
||||
{ "x" integer } { "n" integer }
|
||||
{ "?" "a boolean" }
|
||||
{ "?" boolean }
|
||||
}
|
||||
{ $description "Tests whether unmasking the bits in " { $snippet "x" } " would return an integer greater than zero." }
|
||||
{ $examples
|
||||
|
|
|
@ -256,7 +256,7 @@ HELP: polar>
|
|||
{ $description "Converts an absolute value and argument (polar form) to a complex number." } ;
|
||||
|
||||
HELP: [-1,1]?
|
||||
{ $values { "x" number } { "?" "a boolean" } }
|
||||
{ $values { "x" number } { "?" boolean } }
|
||||
{ $description "Tests if " { $snippet "x" } " is a real number between -1 and 1, inclusive." } ;
|
||||
|
||||
HELP: abs
|
||||
|
@ -286,7 +286,7 @@ HELP: gcd
|
|||
{ $notes "If " { $snippet "d" } " is 1, then " { $snippet "a" } " is the inverse of " { $snippet "y" } " modulo " { $snippet "x" } "." } ;
|
||||
|
||||
HELP: divisor?
|
||||
{ $values { "m" integer } { "n" integer } { "?" "a boolean" } }
|
||||
{ $values { "m" integer } { "n" integer } { "?" boolean } }
|
||||
{ $description "Tests if " { $snippet "n" } " is a divisor of " { $snippet "m" } ". This is the same thing as asking if " { $snippet "m" } " is divisible by " { $snippet "n" } "." }
|
||||
{ $notes "Returns t for both negative and positive divisors, as well as for trivial and non-trivial divisors." } ;
|
||||
|
||||
|
@ -304,7 +304,7 @@ HELP: ^mod
|
|||
{ $description "Outputs the result of computing " { $snippet "x^y mod n" } "." } ;
|
||||
|
||||
HELP: ~
|
||||
{ $values { "x" real } { "y" real } { "epsilon" real } { "?" "a boolean" } }
|
||||
{ $values { "x" real } { "y" real } { "epsilon" real } { "?" boolean } }
|
||||
{ $description "Tests if " { $snippet "x" } " and " { $snippet "y" } " are approximately equal to each other. There are three possible comparison tests, chosen based on the sign of " { $snippet "epsilon" } ":"
|
||||
{ $list
|
||||
{ { $snippet "epsilon" } " is zero: exact comparison." }
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
USING: help.markup help.syntax math math.order ;
|
||||
USING: help.markup help.syntax kernel math math.order ;
|
||||
IN: math.intervals
|
||||
|
||||
ARTICLE: "math-intervals-new" "Creating intervals"
|
||||
|
@ -227,7 +227,7 @@ HELP: interval-log2
|
|||
{ $description "Integer-valued Base-2 logarithm of an interval." } ;
|
||||
|
||||
HELP: interval-intersect
|
||||
{ $values { "i1" interval } { "i2" interval } { "i3" "an " { $link interval } " or " { $link f } } }
|
||||
{ $values { "i1" interval } { "i2" interval } { "i3" { $maybe interval } } }
|
||||
{ $description "Outputs the set-theoretic intersection of " { $snippet "i1" } " and " { $snippet "i2" } ". If " { $snippet "i1" } " and " { $snippet "i2" } " do not intersect, outputs " { $link f } "." } ;
|
||||
|
||||
HELP: interval-union
|
||||
|
@ -235,11 +235,11 @@ HELP: interval-union
|
|||
{ $description "Outputs the smallest interval containing the set-theoretic union of " { $snippet "i1" } " and " { $snippet "i2" } " (the union itself may not be an interval)." } ;
|
||||
|
||||
HELP: interval-subset?
|
||||
{ $values { "i1" interval } { "i2" interval } { "?" "a boolean" } }
|
||||
{ $values { "i1" interval } { "i2" interval } { "?" boolean } }
|
||||
{ $description "Tests if every point of " { $snippet "i1" } " is contained in " { $snippet "i2" } "." } ;
|
||||
|
||||
HELP: interval-contains?
|
||||
{ $values { "x" real } { "int" interval } { "?" "a boolean" } }
|
||||
{ $values { "x" real } { "int" interval } { "?" boolean } }
|
||||
{ $description "Tests if " { $snippet "x" } " is contained in " { $snippet "int" } "." } ;
|
||||
|
||||
HELP: interval-closure
|
||||
|
@ -335,7 +335,7 @@ HELP: assume<=
|
|||
{ $description "Outputs the interval consisting of points from " { $snippet "i1" } " which are less or equal to all points in " { $snippet "i2" } "." } ;
|
||||
|
||||
HELP: assume>
|
||||
{ $values { "i1" interval } { "i2" interval } { "i3" "an " { $link interval } " or " { $link f } } }
|
||||
{ $values { "i1" interval } { "i2" interval } { "i3" { $maybe interval } } }
|
||||
{ $description "Outputs the interval consisting of points from " { $snippet "i1" } " which are greater than all points in " { $snippet "i2" } ". If the resulting interval is empty, outputs " { $link f } "." } ;
|
||||
|
||||
HELP: assume>=
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
USING: help.markup help.syntax math sequences ;
|
||||
USING: help.markup help.syntax kernel math sequences ;
|
||||
IN: math.polynomials
|
||||
|
||||
ARTICLE: "polynomials" "Polynomials"
|
||||
|
@ -31,7 +31,7 @@ HELP: powers
|
|||
{ $examples { $example "USING: math.polynomials prettyprint ;" "4 2 powers ." "{ 1 2 4 8 }" } } ;
|
||||
|
||||
HELP: p=
|
||||
{ $values { "p" "a polynomial" } { "q" "a polynomial" } { "?" "a boolean" } }
|
||||
{ $values { "p" "a polynomial" } { "q" "a polynomial" } { "?" boolean } }
|
||||
{ $description "Tests if two polynomials are equal." }
|
||||
{ $examples { $example "USING: math.polynomials prettyprint ;" "{ 0 1 } { 0 1 0 } p= ." "t" } } ;
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ IN: math.primes.lucas-lehmer
|
|||
HELP: lucas-lehmer
|
||||
{ $values
|
||||
{ "p" "a prime number" }
|
||||
{ "?" "a boolean" }
|
||||
{ "?" boolean }
|
||||
}
|
||||
{ $description "Runs the Lucas-Lehmer test on the prime " { $snippet "p" } " and returns " { $link t } " if " { $snippet "(2 ^ p) - 1" } " is prime." }
|
||||
{ $examples
|
||||
|
|
|
@ -6,7 +6,7 @@ IN: math.primes.miller-rabin
|
|||
HELP: miller-rabin
|
||||
{ $values
|
||||
{ "n" integer }
|
||||
{ "?" "a boolean" }
|
||||
{ "?" boolean }
|
||||
}
|
||||
{ $description "Returns true if the number is a prime. Calls " { $link miller-rabin* } " with a default of 10 Miller-Rabin tests." } ;
|
||||
|
||||
|
@ -15,7 +15,7 @@ HELP: miller-rabin
|
|||
HELP: miller-rabin*
|
||||
{ $values
|
||||
{ "n" integer } { "numtrials" integer }
|
||||
{ "?" "a boolean" }
|
||||
{ "?" boolean }
|
||||
}
|
||||
{ $description "Performs " { $snippet "numtrials" } " trials of the Miller-Rabin probabilistic primality test algorithm and returns true if prime." } ;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
USING: help.markup help.syntax math sequences ;
|
||||
USING: help.markup help.syntax kernel math sequences ;
|
||||
IN: math.primes
|
||||
|
||||
{ next-prime prime? } related-words
|
||||
|
@ -8,21 +8,21 @@ HELP: next-prime
|
|||
{ $description "Return the next prime number greater than " { $snippet "n" } "." } ;
|
||||
|
||||
HELP: prime?
|
||||
{ $values { "n" "an integer" } { "?" "a boolean" } }
|
||||
{ $values { "n" integer } { "?" boolean } }
|
||||
{ $description "Test if an integer is a prime number." } ;
|
||||
|
||||
{ nprimes primes-upto primes-between } related-words
|
||||
|
||||
HELP: nprimes
|
||||
{ $values { "n" "a non-negative integer" } { "seq" "a sequence" } }
|
||||
{ $values { "n" "a non-negative integer" } { "seq" sequence } }
|
||||
{ $description "Return a sequence containing the " { $snippet "n" } " first primes numbers." } ;
|
||||
|
||||
HELP: primes-upto
|
||||
{ $values { "n" "an integer" } { "seq" "a sequence" } }
|
||||
{ $values { "n" integer } { "seq" sequence } }
|
||||
{ $description "Return a sequence containing all the prime numbers smaller or equal to " { $snippet "n" } "." } ;
|
||||
|
||||
HELP: primes-between
|
||||
{ $values { "low" "an integer" } { "high" "an integer" } { "seq" "a sequence" } }
|
||||
{ $values { "low" integer } { "high" integer } { "seq" sequence } }
|
||||
{ $description "Return a sequence containing all the prime numbers between " { $snippet "low" } " and " { $snippet "high" } "." } ;
|
||||
|
||||
HELP: find-relative-prime
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
! Copyright (C) 2009 Doug Coleman.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: combinators.short-circuit help.markup help.syntax kernel
|
||||
math math.functions math.primes random ;
|
||||
USING: help.markup help.syntax kernel math ;
|
||||
IN: math.primes.safe
|
||||
|
||||
HELP: next-safe-prime
|
||||
|
@ -21,7 +20,7 @@ HELP: random-safe-prime
|
|||
HELP: safe-prime?
|
||||
{ $values
|
||||
{ "q" integer }
|
||||
{ "?" "a boolean" }
|
||||
{ "?" boolean }
|
||||
}
|
||||
{ $description "Tests whether the number is a safe prime. A safe prime " { $snippet "p" } " must be prime, as must " { $snippet "(p - 1) / 2" } "." } ;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
USING: help.markup help.syntax ;
|
||||
USING: help.markup help.syntax kernel ;
|
||||
IN: math.rectangles
|
||||
|
||||
HELP: rect
|
||||
|
@ -39,11 +39,11 @@ HELP: rect-intersect
|
|||
{ $description "Computes the intersection of two rectangles." } ;
|
||||
|
||||
HELP: contains-rect?
|
||||
{ $values { "rect1" rect } { "rect2" rect } { "?" "a boolean" } }
|
||||
{ $values { "rect1" rect } { "rect2" rect } { "?" boolean } }
|
||||
{ $description "Tests if two rectangles have a non-empty intersection." } ;
|
||||
|
||||
HELP: contains-point?
|
||||
{ $values { "point" "a pair of integers" } { "rect" rect } { "?" "a boolean" } }
|
||||
{ $values { "point" "a pair of integers" } { "rect" rect } { "?" boolean } }
|
||||
{ $description "Tests if a rectangle contains a point." } ;
|
||||
|
||||
HELP: <zero-rect>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
USING: help.markup help.syntax math math.functions sequences ;
|
||||
USING: help.markup help.syntax kernel math math.functions
|
||||
sequences ;
|
||||
IN: math.vectors
|
||||
|
||||
ARTICLE: "math-vectors-arithmetic" "Vector arithmetic"
|
||||
|
@ -376,7 +377,7 @@ HELP: hrshift
|
|||
{ $description "Shifts the entire SIMD array to the right by " { $snippet "n" } " bytes, filling the vacated left-hand bits with zeroes. This word may only be used in a context where the compiler can statically infer that the input is a SIMD array." } ;
|
||||
|
||||
HELP: vmerge
|
||||
{ $values { "u" "a sequence" } { "v" "a sequence" } { "w" "a sequence" } }
|
||||
{ $values { "u" sequence } { "v" sequence } { "w" sequence } }
|
||||
{ $description "Creates a new sequence of the same type as and twice the length of " { $snippet "u" } " and " { $snippet "v" } " by interleaving the elements of " { $snippet "u" } " and " { $snippet "v" } "." }
|
||||
{ $examples
|
||||
{ $example """USING: kernel math.vectors prettyprint ;
|
||||
|
@ -386,7 +387,7 @@ HELP: vmerge
|
|||
} } ;
|
||||
|
||||
HELP: (vmerge)
|
||||
{ $values { "u" "a sequence" } { "v" "a sequence" } { "h" "a sequence" } { "t" "a sequence" } }
|
||||
{ $values { "u" sequence } { "v" sequence } { "h" sequence } { "t" sequence } }
|
||||
{ $description "Creates two new sequences of the same type and size as " { $snippet "u" } " and " { $snippet "v" } " by interleaving the elements of " { $snippet "u" } " and " { $snippet "v" } "." }
|
||||
{ $notes "For hardware-supported SIMD vector types this word compiles to a single instruction per output value." }
|
||||
{ $examples
|
||||
|
@ -398,7 +399,7 @@ HELP: (vmerge)
|
|||
} } ;
|
||||
|
||||
HELP: (vmerge-head)
|
||||
{ $values { "u" "a sequence" } { "v" "a sequence" } { "h" "a sequence" } }
|
||||
{ $values { "u" sequence } { "v" sequence } { "h" sequence } }
|
||||
{ $description "Creates a new sequence of the same type and size as " { $snippet "u" } " and " { $snippet "v" } " by interleaving the elements from the first half of " { $snippet "u" } " and " { $snippet "v" } "." }
|
||||
{ $notes "For hardware-supported SIMD vector types this word compiles to a single instruction." }
|
||||
{ $examples
|
||||
|
@ -409,7 +410,7 @@ HELP: (vmerge-head)
|
|||
} } ;
|
||||
|
||||
HELP: (vmerge-tail)
|
||||
{ $values { "u" "a sequence" } { "v" "a sequence" } { "t" "a sequence" } }
|
||||
{ $values { "u" sequence } { "v" sequence } { "t" sequence } }
|
||||
{ $description "Creates a new sequence of the same type and size as " { $snippet "u" } " and " { $snippet "v" } " by interleaving the elements from the tail half of " { $snippet "u" } " and " { $snippet "v" } "." }
|
||||
{ $notes "For hardware-supported SIMD vector types this word compiles to a single instruction." }
|
||||
{ $examples
|
||||
|
@ -550,7 +551,7 @@ HELP: v?
|
|||
{ $notes "See " { $link "math-vectors-simd-logic" } " for notes on dealing with vector boolean inputs and results when using SIMD types." } ;
|
||||
|
||||
HELP: vif
|
||||
{ $values { "mask" "a sequence of booleans" } { "true-quot" { $quotation ( -- vector ) } } { "false-quot" { $quotation ( -- vector ) } } { "result" "a sequence" } }
|
||||
{ $values { "mask" "a sequence of booleans" } { "true-quot" { $quotation ( -- vector ) } } { "false-quot" { $quotation ( -- vector ) } } { "result" sequence } }
|
||||
{ $description "If all of the elements of " { $snippet "mask" } " are true, " { $snippet "true-quot" } " is called and its output value returned. If all of the elements of " { $snippet "mask" } " are false, " { $snippet "false-quot" } " is called and its output value returned. Otherwise, both quotations are called and " { $snippet "mask" } " is used to select elements from each output as with " { $link v? } "." }
|
||||
{ $notes "See " { $link "math-vectors-simd-logic" } " for notes on dealing with vector boolean inputs and results when using SIMD types."
|
||||
$nl
|
||||
|
@ -559,17 +560,17 @@ $nl
|
|||
{ v? vif } related-words
|
||||
|
||||
HELP: vany?
|
||||
{ $values { "v" "a sequence of booleans" } { "?" "a boolean" } }
|
||||
{ $values { "v" "a sequence of booleans" } { "?" boolean } }
|
||||
{ $description "Returns true if any element of " { $snippet "v" } " is true." }
|
||||
{ $notes "See " { $link "math-vectors-simd-logic" } " for notes on dealing with vector boolean inputs when using SIMD types." } ;
|
||||
|
||||
HELP: vall?
|
||||
{ $values { "v" "a sequence of booleans" } { "?" "a boolean" } }
|
||||
{ $values { "v" "a sequence of booleans" } { "?" boolean } }
|
||||
{ $description "Returns true if every element of " { $snippet "v" } " is true." }
|
||||
{ $notes "See " { $link "math-vectors-simd-logic" } " for notes on dealing with vector boolean inputs when using SIMD types." } ;
|
||||
|
||||
HELP: vnone?
|
||||
{ $values { "v" "a sequence of booleans" } { "?" "a boolean" } }
|
||||
{ $values { "v" "a sequence of booleans" } { "?" boolean } }
|
||||
{ $description "Returns true if every element of " { $snippet "v" } " is false." }
|
||||
{ $notes "See " { $link "math-vectors-simd-logic" } " for notes on dealing with vector boolean inputs when using SIMD types." } ;
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ HELP: gl-vendor-version
|
|||
{ $description "Wrapper for " { $snippet "GL_VERSION glGetString" } " that returns only the vendor-specific information from the version string." } ;
|
||||
|
||||
HELP: has-gl-version?
|
||||
{ $values { "version" "A version string" } { "?" "A boolean value" } }
|
||||
{ $values { "version" "A version string" } { "?" boolean } }
|
||||
{ $description "Compares the version string returned by " { $link gl-version } " to " { $snippet "version" } ". Returns true if the implementation version meets or exceeds " { $snippet "version" } "." } ;
|
||||
|
||||
HELP: require-gl-version
|
||||
|
@ -27,7 +27,7 @@ HELP: glsl-vendor-version
|
|||
{ $description "Wrapper for " { $snippet "GL_SHADING_LANGUAGE_VERSION glGetString" } " that returns only the vendor-specific information from the version string." } ;
|
||||
|
||||
HELP: has-glsl-version?
|
||||
{ $values { "version" "A version string" } { "?" "A boolean value" } }
|
||||
{ $values { "version" "A version string" } { "?" boolean } }
|
||||
{ $description "Compares the version string returned by " { $link glsl-version } " to " { $snippet "version" } ". Returns true if the implementation version meets or exceeds " { $snippet "version" } "." } ;
|
||||
|
||||
HELP: require-glsl-version
|
||||
|
@ -39,7 +39,7 @@ HELP: gl-extensions
|
|||
{ $description "Wrapper for " { $snippet "GL_EXTENSIONS glGetString" } " that returns a sequence of extension names supported by the OpenGL implementation." } ;
|
||||
|
||||
HELP: has-gl-extensions?
|
||||
{ $values { "extensions" "A sequence of extension name strings" } { "?" "A boolean value" } }
|
||||
{ $values { "extensions" "A sequence of extension name strings" } { "?" boolean } }
|
||||
{ $description "Returns true if the set of " { $snippet "extensions" } " is a subset of the implementation-supported extensions returned by " { $link gl-extensions } ". Elements of " { $snippet "extensions" } " can be sequences, in which case true will be returned if any one of the extensions in the subsequence are available." }
|
||||
{ $examples "Testing for framebuffer object and pixel buffer support:"
|
||||
{ $code """{
|
||||
|
@ -49,7 +49,7 @@ HELP: has-gl-extensions?
|
|||
} ;
|
||||
|
||||
HELP: has-gl-version-or-extensions?
|
||||
{ $values { "version" "A version string" } { "extensions" "A sequence of extension name strings" } { "?" "a boolean" } }
|
||||
{ $values { "version" "A version string" } { "extensions" "A sequence of extension name strings" } { "?" boolean } }
|
||||
{ $description "Returns true if either " { $link has-gl-version? } " or " { $link has-gl-extensions? } " returns true for " { $snippet "version" } " or " { $snippet "extensions" } ", respectively. Intended for use when required OpenGL functionality can be verified either by a minimum version or a set of equivalent extensions." } ;
|
||||
|
||||
HELP: require-gl-extensions
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
USING: help.markup help.syntax io kernel math quotations
|
||||
opengl.gl multiline assocs ;
|
||||
USING: help.markup help.syntax math opengl.gl quotations ;
|
||||
IN: opengl.framebuffers
|
||||
|
||||
HELP: gen-framebuffer
|
||||
|
@ -29,7 +28,7 @@ HELP: check-framebuffer
|
|||
{ $description "Checks the framebuffer currently bound by " { $link glBindFramebuffer } " or " { $link with-framebuffer } " with " { $link framebuffer-incomplete? } ", and throws a descriptive error if the framebuffer is incomplete." } ;
|
||||
|
||||
HELP: with-framebuffer
|
||||
{ $values { "id" "The id of a framebuffer object." } { "quot" "a quotation" } }
|
||||
{ $values { "id" "The id of a framebuffer object." } { "quot" quotation } }
|
||||
{ $description "Binds framebuffer " { $snippet "id" } " for drawing in the dynamic extent of " { $snippet "quot" } ", restoring the window framebuffer when finished." } ;
|
||||
|
||||
ABOUT: "gl-utilities"
|
||||
|
|
|
@ -40,7 +40,7 @@ HELP: <fragment-shader>
|
|||
{ $description "Tries to compile the given GLSL source into a fragment shader object. Equivalent to " { $snippet "GL_FRAGMENT_SHADER <gl-shader>" } "." } ;
|
||||
|
||||
HELP: gl-shader-ok?
|
||||
{ $values { "shader" "A " { $link gl-shader } " object" } { "?" "a boolean" } }
|
||||
{ $values { "shader" "A " { $link gl-shader } " object" } { "?" boolean } }
|
||||
{ $description "Returns a boolean value indicating whether the given shader object compiled successfully. Compilation errors and warnings are available in the shader's info log, which can be gotten using " { $link gl-shader-info-log } "." } ;
|
||||
|
||||
HELP: check-gl-shader
|
||||
|
@ -79,7 +79,7 @@ HELP: <simple-gl-program>
|
|||
{ <gl-program> <simple-gl-program> } related-words
|
||||
|
||||
HELP: gl-program-ok?
|
||||
{ $values { "program" "A " { $link gl-program } " object" } { "?" "a boolean" } }
|
||||
{ $values { "program" "A " { $link gl-program } " object" } { "?" boolean } }
|
||||
{ $description "Returns a boolean value indicating whether the given program object linked successfully. Link errors and warnings are available in the program's info log, which can be gotten using " { $link gl-program-info-log } "." } ;
|
||||
|
||||
HELP: check-gl-program
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
! Copyright (C) 2009 Chris Double.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: help.syntax help.markup peg peg.search ;
|
||||
USING: help.syntax help.markup peg peg.search words ;
|
||||
IN: peg.ebnf
|
||||
|
||||
HELP: <EBNF
|
||||
|
@ -40,7 +40,7 @@ HELP: [EBNF
|
|||
|
||||
HELP: EBNF:
|
||||
{ $syntax "EBNF: word ...ebnf... ;EBNF" }
|
||||
{ $values { "word" "a word" } { "...ebnf..." "EBNF DSL text" } }
|
||||
{ $values { "word" word } { "...ebnf..." "EBNF DSL text" } }
|
||||
{ $description
|
||||
"Defines a word that when called will parse a string using the syntax "
|
||||
"defined with the EBNF DSL. The word has stack effect "
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2008 Chris Double, Doug Coleman.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: help.markup help.syntax peg peg.parsers.private
|
||||
unicode.categories ;
|
||||
USING: help.markup help.syntax kernel math sequences
|
||||
unicode.categories strings ;
|
||||
IN: peg.parsers
|
||||
|
||||
HELP: 1token
|
||||
|
@ -16,9 +16,9 @@ HELP: 1token
|
|||
|
||||
HELP: (list-of)
|
||||
{ $values
|
||||
{ "items" "a sequence" }
|
||||
{ "items" sequence }
|
||||
{ "separator" "a parser" }
|
||||
{ "repeat1?" "a boolean" }
|
||||
{ "repeat1?" boolean }
|
||||
{ "parser" "a parser" }
|
||||
} { $description
|
||||
"Returns a parser that returns a list of items separated by the separator parser. Does not hide the separators."
|
||||
|
@ -26,7 +26,7 @@ HELP: (list-of)
|
|||
|
||||
HELP: list-of
|
||||
{ $values
|
||||
{ "items" "a sequence" }
|
||||
{ "items" sequence }
|
||||
{ "separator" "a parser" }
|
||||
{ "parser" "a parser" }
|
||||
} { $description
|
||||
|
@ -39,7 +39,7 @@ HELP: list-of
|
|||
|
||||
HELP: list-of-many
|
||||
{ $values
|
||||
{ "items" "a sequence" }
|
||||
{ "items" sequence }
|
||||
{ "separator" "a parser" }
|
||||
{ "parser" "a parser" }
|
||||
} { $description
|
||||
|
@ -67,7 +67,7 @@ HELP: any-char
|
|||
HELP: exactly-n
|
||||
{ $values
|
||||
{ "parser" "a parser" }
|
||||
{ "n" "an integer" }
|
||||
{ "n" integer }
|
||||
{ "parser'" "a parser" }
|
||||
} { $description
|
||||
"Returns a parser that matches an exact repetition of the input parser."
|
||||
|
@ -79,7 +79,7 @@ HELP: exactly-n
|
|||
HELP: at-least-n
|
||||
{ $values
|
||||
{ "parser" "a parser" }
|
||||
{ "n" "an integer" }
|
||||
{ "n" integer }
|
||||
{ "parser'" "a parser" }
|
||||
} { $description
|
||||
"Returns a parser that matches n or more repetitions of the input parser."
|
||||
|
@ -92,7 +92,7 @@ HELP: at-least-n
|
|||
HELP: at-most-n
|
||||
{ $values
|
||||
{ "parser" "a parser" }
|
||||
{ "n" "an integer" }
|
||||
{ "n" integer }
|
||||
{ "parser'" "a parser" }
|
||||
} { $description
|
||||
"Returns a parser that matches n or fewer repetitions of the input parser."
|
||||
|
@ -104,8 +104,8 @@ HELP: at-most-n
|
|||
HELP: from-m-to-n
|
||||
{ $values
|
||||
{ "parser" "a parser" }
|
||||
{ "m" "an integer" }
|
||||
{ "n" "an integer" }
|
||||
{ "m" integer }
|
||||
{ "n" integer }
|
||||
{ "parser'" "a parser" }
|
||||
} { $description
|
||||
"Returns a parser that matches between and including m to n repetitions of the input parser."
|
||||
|
@ -130,8 +130,8 @@ HELP: pack
|
|||
HELP: surrounded-by
|
||||
{ $values
|
||||
{ "parser" "a parser" }
|
||||
{ "begin" "a string" }
|
||||
{ "end" "a string" }
|
||||
{ "begin" string }
|
||||
{ "end" string }
|
||||
{ "parser'" "a parser" }
|
||||
} { $description
|
||||
"Calls token on begin and end to make them into string parsers. Returns a parser that parses the begin, body, and end parsers in order. The begin and end parsers are hidden."
|
||||
|
@ -162,7 +162,7 @@ HELP: 'string'
|
|||
|
||||
HELP: range-pattern
|
||||
{ $values
|
||||
{ "pattern" "a string" }
|
||||
{ "pattern" string }
|
||||
{ "parser" "a parser" }
|
||||
} { $description
|
||||
"Returns a parser that matches a single character based on the set "
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
! Copyright (C) 2007 Chris Double.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: help.markup help.syntax ;
|
||||
USING: help.markup help.syntax kernel quotations strings words ;
|
||||
IN: peg
|
||||
|
||||
HELP: parse
|
||||
{ $values
|
||||
{ "input" "a string" }
|
||||
{ "parser" "a parser" }
|
||||
{ "ast" "an object" }
|
||||
{ "input" string }
|
||||
{ "parser" parser }
|
||||
{ "ast" object }
|
||||
}
|
||||
{ $description
|
||||
"Given the input string, parse it using the given parser. The result is the abstract "
|
||||
|
@ -16,8 +16,8 @@ HELP: parse
|
|||
|
||||
HELP: compile
|
||||
{ $values
|
||||
{ "parser" "a parser" }
|
||||
{ "word" "a word" }
|
||||
{ "parser" parser }
|
||||
{ "word" word }
|
||||
}
|
||||
{ $description
|
||||
"Compile the parser to a word. The word will have stack effect ( -- ast )."
|
||||
|
@ -26,16 +26,16 @@ HELP: compile
|
|||
|
||||
HELP: token
|
||||
{ $values
|
||||
{ "string" "a string" }
|
||||
{ "parser" "a parser" }
|
||||
{ "string" string }
|
||||
{ "parser" parser }
|
||||
}
|
||||
{ $description
|
||||
"Returns a parser that matches the given string." } ;
|
||||
|
||||
HELP: satisfy
|
||||
{ $values
|
||||
{ "quot" "a quotation" }
|
||||
{ "parser" "a parser" }
|
||||
{ "quot" quotation }
|
||||
{ "parser" parser }
|
||||
}
|
||||
{ $description
|
||||
"Returns a parser that calls the quotation on the first character of the input string, "
|
||||
|
@ -45,7 +45,7 @@ HELP: range
|
|||
{ $values
|
||||
{ "min" "a character" }
|
||||
{ "max" "a character" }
|
||||
{ "parser" "a parser" }
|
||||
{ "parser" parser }
|
||||
}
|
||||
{ $description
|
||||
"Returns a parser that matches a single character that lies within the range of characters given, inclusive." }
|
||||
|
@ -54,7 +54,7 @@ HELP: range
|
|||
HELP: seq
|
||||
{ $values
|
||||
{ "seq" "a sequence of parsers" }
|
||||
{ "parser" "a parser" }
|
||||
{ "parser" parser }
|
||||
}
|
||||
{ $description
|
||||
"Returns a parser that calls all parsers in the given sequence, in order. The parser succeeds if "
|
||||
|
@ -64,7 +64,7 @@ HELP: seq
|
|||
HELP: choice
|
||||
{ $values
|
||||
{ "seq" "a sequence of parsers" }
|
||||
{ "parser" "a parser" }
|
||||
{ "parser" parser }
|
||||
}
|
||||
{ $description
|
||||
"Returns a parser that will try all the parsers in the sequence, in order, until one succeeds. "
|
||||
|
@ -72,7 +72,7 @@ HELP: choice
|
|||
|
||||
HELP: repeat0
|
||||
{ $values
|
||||
{ "parser" "a parser" }
|
||||
{ "parser" parser }
|
||||
}
|
||||
{ $description
|
||||
"Returns a parser that parses 0 or more instances of the 'p1' parser. The AST produced is "
|
||||
|
@ -81,7 +81,7 @@ HELP: repeat0
|
|||
|
||||
HELP: repeat1
|
||||
{ $values
|
||||
{ "parser" "a parser" }
|
||||
{ "parser" parser }
|
||||
}
|
||||
{ $description
|
||||
"Returns a parser that parses 1 or more instances of the 'p1' parser. The AST produced is "
|
||||
|
@ -89,7 +89,7 @@ HELP: repeat1
|
|||
|
||||
HELP: optional
|
||||
{ $values
|
||||
{ "parser" "a parser" }
|
||||
{ "parser" parser }
|
||||
}
|
||||
{ $description
|
||||
"Returns a parser that parses 0 or 1 instances of the 'p1' parser. The AST produced is "
|
||||
|
@ -97,7 +97,7 @@ HELP: optional
|
|||
|
||||
HELP: semantic
|
||||
{ $values
|
||||
{ "parser" "a parser" }
|
||||
{ "parser" parser }
|
||||
{ "quot" { $quotation ( object -- ? ) } }
|
||||
}
|
||||
{ $description
|
||||
|
@ -109,7 +109,7 @@ HELP: semantic
|
|||
|
||||
HELP: ensure
|
||||
{ $values
|
||||
{ "parser" "a parser" }
|
||||
{ "parser" parser }
|
||||
}
|
||||
{ $description
|
||||
"Returns a parser that succeeds if the 'p1' parser succeeds but does not add anything to the "
|
||||
|
@ -119,7 +119,7 @@ HELP: ensure
|
|||
|
||||
HELP: ensure-not
|
||||
{ $values
|
||||
{ "parser" "a parser" }
|
||||
{ "parser" parser }
|
||||
}
|
||||
{ $description
|
||||
"Returns a parser that succeeds if the 'p1' parser fails but does not add anything to the "
|
||||
|
@ -129,7 +129,7 @@ HELP: ensure-not
|
|||
|
||||
HELP: action
|
||||
{ $values
|
||||
{ "parser" "a parser" }
|
||||
{ "parser" parser }
|
||||
{ "quot" { $quotation ( ast -- ast ) } }
|
||||
}
|
||||
{ $description
|
||||
|
@ -141,7 +141,7 @@ HELP: action
|
|||
|
||||
HELP: sp
|
||||
{ $values
|
||||
{ "parser" "a parser" }
|
||||
{ "parser" parser }
|
||||
}
|
||||
{ $description
|
||||
"Returns a parser that calls the original parser 'p1' after stripping any whitespace "
|
||||
|
@ -149,7 +149,7 @@ HELP: sp
|
|||
|
||||
HELP: hide
|
||||
{ $values
|
||||
{ "parser" "a parser" }
|
||||
{ "parser" parser }
|
||||
}
|
||||
{ $description
|
||||
"Returns a parser that succeeds if the original parser succeeds, but does not "
|
||||
|
@ -158,8 +158,8 @@ HELP: hide
|
|||
|
||||
HELP: delay
|
||||
{ $values
|
||||
{ "quot" "a quotation" }
|
||||
{ "parser" "a parser" }
|
||||
{ "quot" quotation }
|
||||
{ "parser" parser }
|
||||
}
|
||||
{ $description
|
||||
"Delays the construction of a parser until it is actually required to parse. This "
|
||||
|
@ -170,8 +170,8 @@ HELP: delay
|
|||
|
||||
HELP: box
|
||||
{ $values
|
||||
{ "quot" "a quotation" }
|
||||
{ "parser" "a parser" }
|
||||
{ "quot" quotation }
|
||||
{ "parser" parser }
|
||||
}
|
||||
{ $description
|
||||
"Delays the construction of a parser until the parser is compiled. The quotation "
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
! Copyright (C) 2006 Chris Double.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: help.syntax help.markup peg ;
|
||||
USING: help.markup help.syntax kernel peg sequences strings ;
|
||||
IN: peg.search
|
||||
|
||||
HELP: tree-write
|
||||
{ $values
|
||||
{ "object" "an object" } }
|
||||
{ "object" object } }
|
||||
{ $description
|
||||
"Write the object to the standard output stream, unless "
|
||||
"it is an array, in which case recurse through the array "
|
||||
|
@ -14,9 +14,9 @@ HELP: tree-write
|
|||
|
||||
HELP: search
|
||||
{ $values
|
||||
{ "string" "a string" }
|
||||
{ "string" string }
|
||||
{ "parser" "a peg based parser" }
|
||||
{ "seq" "a sequence" }
|
||||
{ "seq" sequence }
|
||||
}
|
||||
{ $description
|
||||
"Returns a sequence containing the parse results of all substrings "
|
||||
|
@ -30,9 +30,9 @@ HELP: search
|
|||
|
||||
HELP: replace
|
||||
{ $values
|
||||
{ "string" "a string" }
|
||||
{ "string" string }
|
||||
{ "parser" "a peg based parser" }
|
||||
{ "result" "a string" }
|
||||
{ "result" string }
|
||||
}
|
||||
{ $description
|
||||
"Returns a copy of the original string but with all substrings that "
|
||||
|
|
|
@ -10,7 +10,7 @@ HELP: <singleton-heap>
|
|||
{ $description "Creates a new persistent heap consisting of one object with the given priority." } ;
|
||||
|
||||
HELP: pheap-empty?
|
||||
{ $values { "heap" "a persistent heap" } { "?" "a boolean" } }
|
||||
{ $values { "heap" "a persistent heap" } { "?" boolean } }
|
||||
{ $description "Returns true if this is an empty persistent heap." } ;
|
||||
|
||||
HELP: pheap-peek
|
||||
|
|
|
@ -2,7 +2,7 @@ IN: porter-stemmer
|
|||
USING: help.markup help.syntax ;
|
||||
|
||||
HELP: step1a
|
||||
{ $values { "str" "a string" } { "newstr" "a new string" } }
|
||||
{ $values { "str" string } { "newstr" "a new string" } }
|
||||
{ $description "Gets rid of plurals." }
|
||||
{ $examples
|
||||
{ $table
|
||||
|
@ -16,7 +16,7 @@ HELP: step1a
|
|||
} ;
|
||||
|
||||
HELP: step1b
|
||||
{ $values { "str" "a string" } { "newstr" "a new string" } }
|
||||
{ $values { "str" string } { "newstr" "a new string" } }
|
||||
{ $description "Gets rid of \"-ed\" and \"-ing\" suffixes." }
|
||||
{ $examples
|
||||
{ $table
|
||||
|
@ -34,23 +34,23 @@ HELP: step1b
|
|||
} ;
|
||||
|
||||
HELP: step1c
|
||||
{ $values { "str" "a string" } { "newstr" "a new string" } }
|
||||
{ $values { "str" string } { "newstr" "a new string" } }
|
||||
{ $description "Turns a terminal y to i when there is another vowel in the stem." } ;
|
||||
|
||||
HELP: step2
|
||||
{ $values { "str" "a string" } { "newstr" "a new string" } }
|
||||
{ $values { "str" string } { "newstr" "a new string" } }
|
||||
{ $description "Maps double suffices to single ones. so -ization maps to -ize etc. note that the string before the suffix must give positive " { $link consonant-seq } "." } ;
|
||||
|
||||
HELP: step3
|
||||
{ $values { "str" "a string" } { "newstr" "a new string" } }
|
||||
{ $values { "str" string } { "newstr" "a new string" } }
|
||||
{ $description "Deals with -c-, -full, -ness, etc. Similar strategy to " { $link step2 } "." } ;
|
||||
|
||||
HELP: step5
|
||||
{ $values { "str" "a string" } { "newstr" "a new string" } }
|
||||
{ $values { "str" string } { "newstr" "a new string" } }
|
||||
{ $description "Removes a final -e and changes a final -ll to -l if " { $link consonant-seq } " is greater than 1," } ;
|
||||
|
||||
HELP: stem
|
||||
{ $values { "str" "a string" } { "newstr" "a new string" } }
|
||||
{ $values { "str" string } { "newstr" "a new string" } }
|
||||
{ $description "Applies the Porter stemming algorithm to the input string." } ;
|
||||
|
||||
ARTICLE: "porter-stemmer" "Porter stemming algorithm"
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
USING: help.markup help.syntax io kernel
|
||||
prettyprint.config prettyprint.sections prettyprint.custom
|
||||
words strings ;
|
||||
USING: help.markup help.syntax kernel prettyprint.config
|
||||
prettyprint.custom sequences strings words ;
|
||||
IN: prettyprint.backend
|
||||
|
||||
ABOUT: "prettyprint-extension"
|
||||
|
||||
HELP: pprint-word
|
||||
{ $values { "word" "a word" } }
|
||||
{ $values { "word" word } }
|
||||
{ $description "Adds a text section for the word. Unlike the " { $link word } " method of " { $link pprint* } ", this does not add a " { $link POSTPONE: POSTPONE: } " prefix to parsing words." }
|
||||
$prettyprinting-note ;
|
||||
|
||||
|
@ -28,21 +27,21 @@ HELP: pprint-string
|
|||
$prettyprinting-note ;
|
||||
|
||||
HELP: nesting-limit?
|
||||
{ $values { "?" "a boolean" } }
|
||||
{ $values { "?" boolean } }
|
||||
{ $description "Tests if the " { $link nesting-limit } " has been reached." }
|
||||
$prettyprinting-note ;
|
||||
|
||||
HELP: check-recursion
|
||||
{ $values { "obj" "an object" } { "quot" { $quotation ( obj -- ) } } }
|
||||
{ $values { "obj" object } { "quot" { $quotation ( obj -- ) } } }
|
||||
{ $description "If the object is already being printed, that is, if the prettyprinter has encountered a cycle in the object graph, or if the maximum nesting depth has been reached, outputs a dummy string. Otherwise applies the quotation to the object." }
|
||||
$prettyprinting-note ;
|
||||
|
||||
HELP: do-length-limit
|
||||
{ $values { "seq" "a sequence" } { "trimmed" "a trimmed sequence" } { "n/f" "an integer or " { $link f } } }
|
||||
{ $values { "seq" sequence } { "trimmed" "a trimmed sequence" } { "n/f" "an integer or " { $link f } } }
|
||||
{ $description "If the " { $link length-limit } " is set and the sequence length exceeds this limit, trims the sequence and outputs a the number of elements which were chopped off the end. Otherwise outputs " { $link f } "." }
|
||||
$prettyprinting-note ;
|
||||
|
||||
HELP: pprint-elements
|
||||
{ $values { "seq" "a sequence" } }
|
||||
{ $values { "seq" sequence } }
|
||||
{ $description "Prettyprints the elements of a sequence, trimming the sequence to " { $link length-limit } " if necessary." }
|
||||
$prettyprinting-note ;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
USING: prettyprint.backend prettyprint.config prettyprint.custom
|
||||
prettyprint.sections help.markup help.syntax
|
||||
io kernel words definitions quotations strings generic classes
|
||||
prettyprint.private ;
|
||||
USING: help.markup help.syntax io kernel math
|
||||
prettyprint.backend prettyprint.config prettyprint.custom
|
||||
prettyprint.private prettyprint.sections sequences ;
|
||||
IN: prettyprint
|
||||
|
||||
ARTICLE: "prettyprint-numbers" "Prettyprinting numbers"
|
||||
|
@ -222,11 +221,11 @@ HELP: short.
|
|||
{ $description "Prettyprints an object to " { $link output-stream } " with a trailing line break. This word rebinds printer control variables to enforce “shorter” output." } ;
|
||||
|
||||
HELP: .b
|
||||
{ $values { "n" "an integer" } }
|
||||
{ $values { "n" integer } }
|
||||
{ $description "Outputs an integer in binary." } ;
|
||||
|
||||
HELP: .o
|
||||
{ $values { "n" "an integer" } }
|
||||
{ $values { "n" integer } }
|
||||
{ $description "Outputs an integer in octal." } ;
|
||||
|
||||
HELP: .h
|
||||
|
@ -234,7 +233,7 @@ HELP: .h
|
|||
{ $description "Outputs an integer or floating-point value in hexadecimal." } ;
|
||||
|
||||
HELP: stack.
|
||||
{ $values { "seq" "a sequence" } }
|
||||
{ $values { "seq" sequence } }
|
||||
{ $description "Prints a the elements of the sequence, one per line." }
|
||||
{ $notes "This word is used in the implementation of " { $link .s } " and " { $link .r } "." } ;
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
USING: prettyprint io kernel help.markup help.syntax
|
||||
prettyprint.config words hashtables math
|
||||
strings definitions quotations ;
|
||||
USING: hashtables help.markup help.syntax io kernel math
|
||||
prettyprint.config quotations strings ;
|
||||
IN: prettyprint.sections
|
||||
|
||||
HELP: position
|
||||
|
@ -10,7 +9,7 @@ HELP: recursion-check
|
|||
{ $var-description "The current nesting of collections being output by the prettyprinter, used to detect circularity and prevent infinite recursion." } ;
|
||||
|
||||
HELP: line-limit?
|
||||
{ $values { "?" "a boolean" } }
|
||||
{ $values { "?" boolean } }
|
||||
{ $description "Tests if the line number limit has been reached, and thus if prettyprinting should stop." } ;
|
||||
|
||||
HELP: do-indent
|
||||
|
@ -29,7 +28,7 @@ HELP: hard
|
|||
{ soft hard } related-words
|
||||
|
||||
HELP: section-fits?
|
||||
{ $values { "section" section } { "?" "a boolean" } }
|
||||
{ $values { "section" section } { "?" boolean } }
|
||||
{ $contract "Tests if a section fits in the space that remains on the current line." } ;
|
||||
|
||||
HELP: short-section
|
||||
|
@ -41,20 +40,20 @@ HELP: long-section
|
|||
{ $contract "Prints a section which spans multiple lines. This should use a layout strategy maximizing readability and minimizing line length." } ;
|
||||
|
||||
HELP: indent-section?
|
||||
{ $values { "section" section } { "?" "a boolean" } }
|
||||
{ $values { "section" section } { "?" boolean } }
|
||||
{ $contract "Outputs a boolean indicating if the indent level should be increased when printing this section as a " { $link long-section } ". Default implementation outputs " { $link f } "." } ;
|
||||
|
||||
HELP: unindent-first-line?
|
||||
{ $values { "section" section } { "?" "a boolean" } }
|
||||
{ $values { "section" section } { "?" boolean } }
|
||||
{ $contract "Outputs a boolean indicating if the indent level should only be increased for lines after the first line when printing this section as a " { $link long-section } ". Default implementation outputs " { $link f } "." }
|
||||
{ $notes "This is used to format " { $link colon } " sections because of the colon definition formatting convention." } ;
|
||||
|
||||
HELP: newline-after?
|
||||
{ $values { "section" section } { "?" "a boolean" } }
|
||||
{ $values { "section" section } { "?" boolean } }
|
||||
{ $contract "Outputs a boolean indicating if a newline should be output after printing this section as a " { $link long-section } ". Default implementation outputs " { $link f } "." } ;
|
||||
|
||||
HELP: short-section?
|
||||
{ $values { "section" section } { "?" "a boolean" } }
|
||||
{ $values { "section" section } { "?" boolean } }
|
||||
{ $contract "Tests if a section should be output as a " { $link short-section } ". The default implementation calls " { $link section-fits? } " but this behavior can be customized." } ;
|
||||
|
||||
HELP: section
|
||||
|
@ -152,7 +151,7 @@ HELP: do-break
|
|||
{ $description "Prints a break section as per the policy outlined in " { $link line-break } "." } ;
|
||||
|
||||
HELP: empty-block?
|
||||
{ $values { "block" block } { "?" "a boolean" } }
|
||||
{ $values { "block" block } { "?" boolean } }
|
||||
{ $description "Tests if the block has no child sections." } ;
|
||||
|
||||
HELP: if-nonempty
|
||||
|
@ -184,7 +183,7 @@ HELP: inset
|
|||
{ $class-description "A " { $link block } " section which indents every line when printed as a " { $link long-section } "." } ;
|
||||
|
||||
HELP: <inset
|
||||
{ $values { "narrow?" "a boolean" } }
|
||||
{ $values { "narrow?" boolean } }
|
||||
{ $description "Begins an " { $link inset } " section. When printed as a " { $link long-section } ", the output format is determined by the " { $snippet "narrow?" } " flag. If it is " { $link f } ", then longer lines are favored, wrapping at the " { $link margin } ". Otherwise, every child section is printed on its own line." }
|
||||
{ $examples
|
||||
"Compare the output of printing a long quotation versus a hashtable. Quotations are printed with " { $snippet "narrow?" } " set to " { $link f } ", and hashtables are printed with " { $snippet "narrow?" } " set to " { $link t } "."
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
! Copyright (C) 2009 Keith Lazuka.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: help.markup help.syntax kernel words ;
|
||||
USING: help.markup help.syntax kernel strings words ;
|
||||
IN: prettyprint.stylesheet
|
||||
|
||||
HELP: effect-style
|
||||
|
@ -12,7 +12,7 @@ HELP: effect-style
|
|||
|
||||
HELP: string-style
|
||||
{ $values
|
||||
{ "str" "a string" }
|
||||
{ "str" string }
|
||||
{ "style" "a style assoc" }
|
||||
}
|
||||
{ $description "The stylesheet for string literals" } ;
|
||||
|
@ -26,7 +26,7 @@ HELP: vocab-style
|
|||
|
||||
HELP: word-style
|
||||
{ $values
|
||||
{ "word" "a word" }
|
||||
{ "word" word }
|
||||
{ "style" "a style assoc" }
|
||||
}
|
||||
{ $description "The stylesheet for word names" } ;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
USING: help.markup help.syntax math kernel sequences arrays ;
|
||||
USING: arrays help.markup help.syntax kernel math quotations
|
||||
sequences ;
|
||||
IN: random
|
||||
|
||||
HELP: seed-random
|
||||
|
@ -14,7 +15,7 @@ HELP: random-32*
|
|||
{ $description "Generates a random 32-bit unsigned integer." } ;
|
||||
|
||||
HELP: random-bytes*
|
||||
{ $values { "n" "an integer" } { "obj" "a random number generator" } { "byte-array" "a sequence of random bytes" } }
|
||||
{ $values { "n" integer } { "obj" "a random number generator" } { "byte-array" "a sequence of random bytes" } }
|
||||
{ $description "Generates a byte-array of random bytes." } ;
|
||||
|
||||
HELP: random
|
||||
|
@ -36,7 +37,7 @@ HELP: random-32
|
|||
{ $description "Outputs 32 random bits. This word is more efficient than calling " { $link random } " because no scaling is done on the output." } ;
|
||||
|
||||
HELP: random-bytes
|
||||
{ $values { "n" "an integer" } { "byte-array" "a random integer" } }
|
||||
{ $values { "n" integer } { "byte-array" "a random integer" } }
|
||||
{ $description "Outputs an integer with n bytes worth of bits." }
|
||||
{ $examples
|
||||
{ $unchecked-example "USING: prettyprint random ;"
|
||||
|
@ -86,15 +87,15 @@ HELP: random-bits*
|
|||
{ $description "Returns an integer exactly " { $snippet "numbits" } " in length, with the topmost bit set to one." } ;
|
||||
|
||||
HELP: with-random
|
||||
{ $values { "obj" "a random number generator" } { "quot" "a quotation" } }
|
||||
{ $values { "obj" "a random number generator" } { "quot" quotation } }
|
||||
{ $description "Calls the quotation with the random number generator in a dynamic variable. All random numbers will be generated using this random number generator." } ;
|
||||
|
||||
HELP: with-secure-random
|
||||
{ $values { "quot" "a quotation" } }
|
||||
{ $values { "quot" quotation } }
|
||||
{ $description "Calls the quotation with the secure random number generator in a dynamic variable. All random numbers will be generated using this random number generator." } ;
|
||||
|
||||
HELP: with-system-random
|
||||
{ $values { "quot" "a quotation" } }
|
||||
{ $values { "quot" quotation } }
|
||||
{ $description "Calls the quotation with the system's random number generator in a dynamic variable. All random numbers will be generated using this random number generator." } ;
|
||||
|
||||
{ with-random with-secure-random with-system-random } related-words
|
||||
|
|
|
@ -210,7 +210,7 @@ HELP: regexp
|
|||
{ $class-description "The class of regular expressions. To construct these, see " { $link "regexp-construction" } "." } ;
|
||||
|
||||
HELP: matches?
|
||||
{ $values { "string" string } { "regexp" regexp } { "?" "a boolean" } }
|
||||
{ $values { "string" string } { "regexp" regexp } { "?" boolean } }
|
||||
{ $description "Tests if the string as a whole matches the given regular expression." } ;
|
||||
|
||||
HELP: all-matching-slices
|
||||
|
@ -252,5 +252,5 @@ HELP: first-match
|
|||
{ $description "Finds the first match of the regular expression in the string, and returns it as a slice. If there is no match, then " { $link f } " is returned." } ;
|
||||
|
||||
HELP: re-contains?
|
||||
{ $values { "string" string } { "regexp" regexp } { "?" "a boolean" } }
|
||||
{ $values { "string" string } { "regexp" regexp } { "?" boolean } }
|
||||
{ $description "Determines whether the string has a substring which matches the regular expression given." } ;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
USING: help.markup help.syntax strings definitions generic words classes ;
|
||||
USING: classes definitions generic help.markup help.syntax
|
||||
sequences strings words ;
|
||||
FROM: prettyprint.sections => with-pprint ;
|
||||
IN: see
|
||||
|
||||
|
@ -42,7 +43,7 @@ HELP: definer
|
|||
{ $notes "This word is used in the implementation of " { $link see } "." } ;
|
||||
|
||||
HELP: definition
|
||||
{ $values { "defspec" "a definition specifier" } { "seq" "a sequence" } }
|
||||
{ $values { "defspec" "a definition specifier" } { "seq" sequence } }
|
||||
{ $contract "Outputs the body of a definition." }
|
||||
{ $examples
|
||||
{ $example "USING: definitions math prettyprint ;" "\\ sq definition ." "[ dup * ]" }
|
||||
|
|
|
@ -26,7 +26,7 @@ HELP: deep-find
|
|||
{ $see-also find } ;
|
||||
|
||||
HELP: deep-any?
|
||||
{ $values { "obj" object } { "quot" { $quotation ( ... elt -- ... ? ) } } { "?" "a boolean" } }
|
||||
{ $values { "obj" object } { "quot" { $quotation ( ... elt -- ... ? ) } } { "?" boolean } }
|
||||
{ $description "Tests whether the given object or any subnode satisfies the given quotation." }
|
||||
{ $see-also any? } ;
|
||||
|
||||
|
|
|
@ -1,11 +1,5 @@
|
|||
USING: help.syntax help.markup kernel sequences words io
|
||||
effects classes math combinators
|
||||
stack-checker.backend
|
||||
stack-checker.branches
|
||||
stack-checker.errors
|
||||
stack-checker.transforms
|
||||
stack-checker.state
|
||||
continuations ;
|
||||
USING: classes continuations effects help.markup help.syntax io
|
||||
kernel quotations sequences stack-checker.errors ;
|
||||
IN: stack-checker
|
||||
|
||||
ARTICLE: "inference-simple" "Straight-line stack effects"
|
||||
|
@ -160,12 +154,12 @@ HELP: inference-error
|
|||
} ;
|
||||
|
||||
HELP: infer
|
||||
{ $values { "quot" "a quotation" } { "effect" "an instance of " { $link effect } } }
|
||||
{ $values { "quot" quotation } { "effect" "an instance of " { $link effect } } }
|
||||
{ $description "Attempts to infer the quotation's stack effect. For interactive testing, the " { $link infer. } " word should be called instead since it presents the output in a nicely formatted manner." }
|
||||
{ $errors "Throws an " { $link inference-error } " if stack effect inference fails." } ;
|
||||
|
||||
HELP: infer.
|
||||
{ $values { "quot" "a quotation" } }
|
||||
{ $values { "quot" quotation } }
|
||||
{ $description "Attempts to infer the quotation's stack effect, and prints this data to " { $link output-stream } "." }
|
||||
{ $errors "Throws an " { $link inference-error } " if stack effect inference fails." } ;
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ $nl
|
|||
ABOUT: "tools.annotations"
|
||||
|
||||
HELP: annotate
|
||||
{ $values { "word" "a word" } { "quot" { $quotation ( old-def -- new-def ) } } }
|
||||
{ $values { "word" word } { "quot" { $quotation ( old-def -- new-def ) } } }
|
||||
{ $description "Changes a word definition to the result of applying a quotation to the old definition." }
|
||||
{ $notes "This word is used to implement " { $link watch } "." } ;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
USING: help.markup help.syntax words definitions prettyprint
|
||||
tools.crossref.private math quotations assocs kernel sets ;
|
||||
USING: assocs help.markup help.syntax kernel math sets
|
||||
tools.crossref.private words ;
|
||||
IN: tools.crossref
|
||||
|
||||
ARTICLE: "tools.crossref" "Definition cross referencing"
|
||||
|
@ -50,7 +50,7 @@ HELP: usage
|
|||
{ $notes "The sequence might include the definition itself, if it is a recursive word." } ;
|
||||
|
||||
HELP: usage.
|
||||
{ $values { "word" "a word" } }
|
||||
{ $values { "word" word } }
|
||||
{ $description "Prints an list of all callers of a word. This may include the word itself, if it is recursive." }
|
||||
{ $examples { $code "\\ reverse usage." } } ;
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
USING: ui.gadgets ui.gestures help.markup help.syntax strings ;
|
||||
USING: help.markup help.syntax kernel strings ui.gadgets
|
||||
ui.gestures ;
|
||||
IN: ui.clipboards
|
||||
|
||||
HELP: clipboard
|
||||
|
@ -6,11 +7,11 @@ HELP: clipboard
|
|||
{ $class-description "A mutable container for a single string implementing the " { $link "clipboard-protocol" } "." } ;
|
||||
|
||||
HELP: paste-clipboard
|
||||
{ $values { "gadget" gadget } { "clipboard" "an object" } }
|
||||
{ $values { "gadget" gadget } { "clipboard" object } }
|
||||
{ $contract "Arranges for the contents of the clipboard to be inserted into the gadget at some point in the near future via a call to " { $link user-input } ". The gadget must be grafted." } ;
|
||||
|
||||
HELP: copy-clipboard
|
||||
{ $values { "string" string } { "gadget" gadget } { "clipboard" "an object" } }
|
||||
{ $values { "string" string } { "gadget" gadget } { "clipboard" object } }
|
||||
{ $contract "Arranges for the string to be copied to the clipboard on behalf of the gadget. The gadget must be grafted." } ;
|
||||
|
||||
HELP: selection
|
||||
|
|
|
@ -26,7 +26,7 @@ HELP: relative-loc
|
|||
} ;
|
||||
|
||||
HELP: user-input*
|
||||
{ $values { "str" string } { "gadget" gadget } { "?" "a boolean" } }
|
||||
{ $values { "str" string } { "gadget" gadget } { "?" boolean } }
|
||||
{ $contract "Handle free-form textual input while the gadget has keyboard focus." } ;
|
||||
|
||||
HELP: children-on
|
||||
|
@ -49,7 +49,7 @@ HELP: each-child
|
|||
{ $description "Applies the quotation to each child of the gadget." } ;
|
||||
|
||||
HELP: gadget-selection?
|
||||
{ $values { "gadget" gadget } { "?" "a boolean" } }
|
||||
{ $values { "gadget" gadget } { "?" boolean } }
|
||||
{ $contract "Outputs if the gadget has an active text selection; if so, the selected text can be obtained with a call to " { $link gadget-selection } "." } ;
|
||||
|
||||
HELP: gadget-selection
|
||||
|
@ -147,7 +147,7 @@ HELP: parents
|
|||
{ $description "Outputs a sequence of all parents of the gadget, with the first element being the gadget itself." } ;
|
||||
|
||||
HELP: each-parent
|
||||
{ $values { "gadget" gadget } { "quot" { $quotation ( gadget -- ? ) } } { "?" "a boolean" } }
|
||||
{ $values { "gadget" gadget } { "quot" { $quotation ( gadget -- ? ) } } { "?" boolean } }
|
||||
{ $description "Applies the quotation to every parent of the gadget, starting from the gadget itself, stopping if the quotation yields " { $link f } ". Outputs " { $link t } " if the iteration completed, and outputs " { $link f } " if it was stopped prematurely." } ;
|
||||
|
||||
HELP: find-parent
|
||||
|
@ -159,7 +159,7 @@ HELP: screen-loc
|
|||
{ $description "Outputs the location of the gadget relative to the top-left corner of the world containing the gadget. This word does not output a useful value if the gadget is not grafted." } ;
|
||||
|
||||
HELP: child?
|
||||
{ $values { "parent" gadget } { "child" gadget } { "?" "a boolean" } }
|
||||
{ $values { "parent" gadget } { "child" gadget } { "?" boolean } }
|
||||
{ $description "Tests if " { $snippet "child" } " is contained inside " { $snippet "parent" } "." } ;
|
||||
|
||||
HELP: focusable-child*
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
USING: help.markup help.syntax kernel math.rectangles
|
||||
ui.gadgets ;
|
||||
IN: ui.gadgets.glass
|
||||
USING: help.markup help.syntax ui.gadgets math.rectangles ;
|
||||
|
||||
HELP: show-glass
|
||||
{ $values { "owner" gadget } { "child" gadget } { "visible-rect" rect } }
|
||||
|
@ -23,7 +24,7 @@ HELP: hide-glass-hook
|
|||
{ $description "Called when a gadget displayed in a glass layer is hidden. The gadget can perform cleanup tasks here." } ;
|
||||
|
||||
HELP: pass-to-popup
|
||||
{ $values { "gesture" "a gesture" } { "owner" "the popup's owner" } { "?" "a boolean" } }
|
||||
{ $values { "gesture" "a gesture" } { "owner" "the popup's owner" } { "?" boolean } }
|
||||
{ $description "Resends the gesture to the popup displayed by " { $snippet "owner" } ". The owner must have a " { $slot "popup" } " slot. Outputs " { $link f } " if the gesture was handled, " { $link t } " otherwise." } ;
|
||||
|
||||
HELP: show-popup
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
USING: help.markup help.syntax ui.gadgets models models.range
|
||||
USING: help.markup help.syntax math math.ranges ui.gadgets
|
||||
ui.gadgets.sliders.private ;
|
||||
IN: ui.gadgets.sliders
|
||||
|
||||
|
@ -18,15 +18,15 @@ HELP: thumb
|
|||
{ $class-description "A thumb is the gadget contained in a " { $link slider } "'s " { $link elevator } " which indicates the current scroll position and can be dragged up and down with the mouse." } ;
|
||||
|
||||
HELP: slide-by
|
||||
{ $values { "amount" "an integer" } { "slider" slider } }
|
||||
{ $values { "amount" integer } { "slider" slider } }
|
||||
{ $description "Adds the amount (which may be positive or negative) to the slider's current position." } ;
|
||||
|
||||
HELP: slide-by-page
|
||||
{ $values { "amount" "an integer" } { "slider" slider } }
|
||||
{ $values { "amount" integer } { "slider" slider } }
|
||||
{ $description "Adds the amount multiplied by " { $link slider-page } " to the slider's current position." } ;
|
||||
|
||||
HELP: slide-by-line
|
||||
{ $values { "amount" "an integer" } { "slider" slider } }
|
||||
{ $values { "amount" integer } { "slider" slider } }
|
||||
{ $description "Adds the amount multiplied by the " { $snippet "line" } " slot to the slider's current position." } ;
|
||||
|
||||
HELP: <slider>
|
||||
|
|
|
@ -7,7 +7,7 @@ HELP: set-gestures
|
|||
{ $description "Sets the gestures a gadget class responds to. The hashtable maps gestures to quotations with stack effect " { $snippet "( gadget -- )" } "." } ;
|
||||
|
||||
HELP: handle-gesture
|
||||
{ $values { "gesture" "a gesture" } { "gadget" "the receiver of the gesture" } { "?" "a boolean" } }
|
||||
{ $values { "gesture" "a gesture" } { "gadget" "the receiver of the gesture" } { "?" boolean } }
|
||||
{ $contract "Handles a gesture sent to a gadget."
|
||||
$nl
|
||||
"Outputs " { $link f } " if the gesture was handled, and " { $link t } " if the gesture should be passed on to the gadget's parent."
|
||||
|
@ -16,14 +16,14 @@ $nl
|
|||
{ $notes "Methods should be defined on this word if you desire to handle an arbitrary set of gestures. To define handlers for a fixed set, it is easier to use " { $link set-gestures } ". If you define a method on " { $snippet "handle-gesture" } ", you should also override " { $link handles-gesture? } "." } ;
|
||||
|
||||
HELP: handles-gesture?
|
||||
{ $values { "gesture" "a gesture" } { "gadget" "the receiver of the gesture" } { "?" "a boolean" } }
|
||||
{ $values { "gesture" "a gesture" } { "gadget" "the receiver of the gesture" } { "?" boolean } }
|
||||
{ $contract "Returns a true value if " { $snippet "gadget" } " would handle " { $snippet "gesture" } " in its " { $link handle-gesture } " method."
|
||||
$nl
|
||||
"The default implementation looks at the " { $snippet "\"gestures\"" } " word property of each superclass of the gadget's class and returns true if a handler is present for " { $snippet "gesture" } "." }
|
||||
{ $notes "This word is used in Factor's MacOS X UI to validate menu items." } ;
|
||||
|
||||
HELP: parents-handle-gesture?
|
||||
{ $values { "gesture" "a gesture" } { "gadget" "the receiver of the gesture" } { "?" "a boolean" } }
|
||||
{ $values { "gesture" "a gesture" } { "gadget" "the receiver of the gesture" } { "?" boolean } }
|
||||
{ $contract "Returns a true value if " { $snippet "gadget" } " or any of its ancestors would handle " { $snippet "gesture" } " in its " { $link handle-gesture } " method." } ;
|
||||
|
||||
{ propagate-gesture handle-gesture handles-gesture? set-gestures } related-words
|
||||
|
|
|
@ -65,7 +65,7 @@ HELP: define-operation-map
|
|||
{ $description "Defines a command map named " { $snippet "group" } " on " { $snippet "class" } " consisting of operations applicable to " { $snippet "object" } ". The translator quotation is applied to the target gadget, and the result of the translator is passed to the operation." } ;
|
||||
|
||||
HELP: $operations
|
||||
{ $values { "element" "a sequence" } }
|
||||
{ $values { "element" sequence } }
|
||||
{ $description "Converts the element to a quotation and calls it; the resulting quotation must have stack effect " { $snippet "( -- obj )" } ". Prints a list of operations applicable to the object, together with keyboard shortcuts." } ;
|
||||
|
||||
HELP: $operation
|
||||
|
|
|
@ -32,11 +32,11 @@ HELP: world-attributes
|
|||
} ;
|
||||
|
||||
HELP: set-fullscreen
|
||||
{ $values { "gadget" gadget } { "?" "a boolean" } }
|
||||
{ $values { "gadget" gadget } { "?" boolean } }
|
||||
{ $description "Sets and unsets fullscreen mode for the gadget's world." } ;
|
||||
|
||||
HELP: fullscreen?
|
||||
{ $values { "gadget" gadget } { "?" "a boolean" } }
|
||||
{ $values { "gadget" gadget } { "?" boolean } }
|
||||
{ $description "Queries the gadget's world to see if it is running in fullscreen mode." } ;
|
||||
|
||||
{ fullscreen? set-fullscreen } related-words
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
USING: help.syntax help.markup strings ;
|
||||
USING: help.syntax help.markup kernel strings ;
|
||||
IN: unicode.case
|
||||
|
||||
ABOUT: "unicode.case"
|
||||
|
@ -39,17 +39,17 @@ HELP: >case-fold
|
|||
{ $description "Converts a string to case-folded form." } ;
|
||||
|
||||
HELP: upper?
|
||||
{ $values { "string" string } { "?" "a boolean" } }
|
||||
{ $values { "string" string } { "?" boolean } }
|
||||
{ $description "Tests if a string is in upper case." } ;
|
||||
|
||||
HELP: lower?
|
||||
{ $values { "string" string } { "?" "a boolean" } }
|
||||
{ $values { "string" string } { "?" boolean } }
|
||||
{ $description "Tests if a string is in lower case." } ;
|
||||
|
||||
HELP: title?
|
||||
{ $values { "string" string } { "?" "a boolean" } }
|
||||
{ $values { "string" string } { "?" boolean } }
|
||||
{ $description "Tests if a string is in title case." } ;
|
||||
|
||||
HELP: case-fold?
|
||||
{ $values { "string" string } { "?" "a boolean" } }
|
||||
{ $values { "string" string } { "?" boolean } }
|
||||
{ $description "Tests if a string is in case-folded form." } ;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
! Copyright (C) 2009 Daniel Ehrenberg
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: help.syntax help.markup strings ;
|
||||
USING: help.syntax help.markup kernel math strings ;
|
||||
IN: unicode.data
|
||||
|
||||
ABOUT: "unicode.data"
|
||||
|
@ -35,11 +35,11 @@ HELP: compatibility-entry
|
|||
{ $description "This returns the compatibility decomposition (NFKD) for a code point" } ;
|
||||
|
||||
HELP: combining-class
|
||||
{ $values { "char" "a code point" } { "n" "an integer" } }
|
||||
{ $values { "char" "a code point" } { "n" integer } }
|
||||
{ $description "Finds the combining class of a code point." } ;
|
||||
|
||||
HELP: non-starter?
|
||||
{ $values { "char" "a code point" } { "?" "a boolean" } }
|
||||
{ $values { "char" "a code point" } { "?" boolean } }
|
||||
{ $description "Returns true if the code point has a combining class." } ;
|
||||
|
||||
HELP: char>name
|
||||
|
@ -51,7 +51,7 @@ HELP: name>char
|
|||
{ $description "Looks up the code point corresponding to a given name." } ;
|
||||
|
||||
HELP: property?
|
||||
{ $values { "char" "a code point" } { "property" string } { "?" "a boolean" } }
|
||||
{ $values { "char" "a code point" } { "property" string } { "?" boolean } }
|
||||
{ $description "Tests whether the code point is listed under the given property in PropList.txt in the Unicode Character Database." } ;
|
||||
|
||||
HELP: category
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
USING: strings help.markup help.syntax assocs urls ;
|
||||
USING: assocs help.markup help.syntax kernel strings ;
|
||||
IN: urls.encoding
|
||||
|
||||
HELP: url-decode
|
||||
|
@ -14,7 +14,7 @@ HELP: url-encode-full
|
|||
{ $description "URL-encodes a string, including all reserved characters, such as \"/\"." } ;
|
||||
|
||||
HELP: url-quotable?
|
||||
{ $values { "ch" "a character" } { "?" "a boolean" } }
|
||||
{ $values { "ch" "a character" } { "?" boolean } }
|
||||
{ $description "Tests if a character be used without URL-encoding in a URL." } ;
|
||||
|
||||
HELP: assoc>query
|
||||
|
|
|
@ -133,11 +133,11 @@ HELP: relative-url
|
|||
HELP: relative-url?
|
||||
{ $values
|
||||
{ "url" url }
|
||||
{ "?" "a boolean" } }
|
||||
{ "?" boolean } }
|
||||
{ $description "Tests whether a URL is relative." } ;
|
||||
|
||||
HELP: secure-protocol?
|
||||
{ $values { "protocol" string } { "?" "a boolean" } }
|
||||
{ $values { "protocol" string } { "?" boolean } }
|
||||
{ $description "Tests if protocol connections must be made with secure sockets (SSL/TLS)." }
|
||||
{ $examples
|
||||
{ $example
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
USING: help.markup help.syntax io.streams.string quotations
|
||||
strings math regexp ;
|
||||
USING: help.markup help.syntax kernel math quotations regexp
|
||||
strings ;
|
||||
IN: validators
|
||||
|
||||
HELP: v-checkbox
|
||||
{ $values { "str" string } { "?" "a boolean" } }
|
||||
{ $values { "str" string } { "?" boolean } }
|
||||
{ $description "Converts the string value of a checkbox component (either \"on\" or \"off\") to a boolean value." } ;
|
||||
|
||||
HELP: v-captcha
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
USING: help.markup help.syntax strings ;
|
||||
USING: help.markup help.syntax kernel strings ;
|
||||
IN: vocabs.refresh
|
||||
|
||||
HELP: source-modified?
|
||||
{ $values { "path" "a pathname string" } { "?" "a boolean" } }
|
||||
{ $values { "path" "a pathname string" } { "?" boolean } }
|
||||
{ $description "Tests if the source file has been modified since it was last loaded. This compares the file's CRC32 checksum of the file's contents against the previously-recorded value." } ;
|
||||
|
||||
HELP: refresh
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
USING: help.syntax help.markup ;
|
||||
USING: help.syntax help.markup math sequences strings ;
|
||||
IN: xml-rpc
|
||||
|
||||
HELP: send-rpc
|
||||
|
@ -12,7 +12,7 @@ HELP: receive-rpc
|
|||
{ $see-also send-rpc } ;
|
||||
|
||||
HELP: <base64>
|
||||
{ $values { "string" "a string" } { "base64" "a base64 tuple" } }
|
||||
{ $values { "string" string } { "base64" "a base64 tuple" } }
|
||||
{ $description "creates a base64 tuple using the data in the string. This marks the data for encoding in the base64 format" }
|
||||
{ $see-also base64 } ;
|
||||
|
||||
|
@ -21,7 +21,7 @@ HELP: base64
|
|||
{ $see-also <base64> } ;
|
||||
|
||||
HELP: <rpc-method>
|
||||
{ $values { "name" "a string" } { "params" "a sequence" } { "rpc-method" rpc-method } }
|
||||
{ $values { "name" string } { "params" sequence } { "rpc-method" rpc-method } }
|
||||
{ $description "creates a tuple representing a method call which can be translated using send-rpc into an XML-RPC document" }
|
||||
{ $see-also rpc-method <rpc-response> <rpc-fault> } ;
|
||||
|
||||
|
@ -30,7 +30,7 @@ HELP: rpc-method
|
|||
{ $see-also <rpc-method> rpc-response rpc-fault } ;
|
||||
|
||||
HELP: <rpc-response>
|
||||
{ $values { "params" "a sequence" } { "rpc-response" rpc-response } }
|
||||
{ $values { "params" sequence } { "rpc-response" rpc-response } }
|
||||
{ $description "creates a tuple representing a data response in XML-RPC" }
|
||||
{ $see-also rpc-response <rpc-method> <rpc-fault> } ;
|
||||
|
||||
|
@ -39,7 +39,7 @@ HELP: rpc-response
|
|||
{ $see-also <rpc-response> rpc-method rpc-fault } ;
|
||||
|
||||
HELP: <rpc-fault>
|
||||
{ $values { "code" "an integer" } { "string" "a string" } { "rpc-fault" rpc-fault } }
|
||||
{ $values { "code" integer } { "string" string } { "rpc-fault" rpc-fault } }
|
||||
{ $description "creates a tuple representing an exception in RPC, to be returned to the caller. The code is a number representing what type of error it is, and the string is a description" }
|
||||
{ $see-also rpc-fault <rpc-method> <rpc-response> } ;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
USING: help.markup help.syntax sequences strings ;
|
||||
USING: help.markup help.syntax kernel sequences strings ;
|
||||
IN: xml.data
|
||||
|
||||
ABOUT: "xml.data"
|
||||
|
@ -78,7 +78,7 @@ HELP: name
|
|||
{ $see-also <name> tag } ;
|
||||
|
||||
HELP: <name>
|
||||
{ $values { "space" "a string" } { "main" "a string" } { "url" "a string" }
|
||||
{ $values { "space" string } { "main" string } { "url" string }
|
||||
{ "name" "an XML tag name" } }
|
||||
{ $description "Creates a name tuple with the namespace prefix space, the the given main part of the name, and the namespace URL given by url." }
|
||||
{ $see-also name <tag> } ;
|
||||
|
@ -110,7 +110,7 @@ HELP: prolog
|
|||
|
||||
HELP: <prolog>
|
||||
{ $values { "version" "a string, 1.0 or 1.1" }
|
||||
{ "encoding" "a string" } { "standalone" "a boolean" } { "prolog" "an XML prolog" } }
|
||||
{ "encoding" string } { "standalone" boolean } { "prolog" "an XML prolog" } }
|
||||
{ $description "Creates an XML prolog tuple." }
|
||||
{ $see-also prolog <xml> } ;
|
||||
|
||||
|
@ -128,7 +128,7 @@ HELP: instruction
|
|||
{ $see-also <instruction> } ;
|
||||
|
||||
HELP: <instruction>
|
||||
{ $values { "text" "a string" } { "instruction" "an XML instruction" } }
|
||||
{ $values { "text" string } { "instruction" "an XML instruction" } }
|
||||
{ $description "Creates an XML parsing instruction, like " { $snippet "<?xsl stylesheet='foo.xml'?>" } "." }
|
||||
{ $see-also instruction } ;
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ HELP: deep-tags-named
|
|||
{ $see-also tag-named deep-tag-named tags-named } ;
|
||||
|
||||
HELP: children>string
|
||||
{ $values { "tag" "an XML tag or document" } { "string" "a string" } }
|
||||
{ $values { "tag" "an XML tag or document" } { "string" string } }
|
||||
{ $description "Concatenates the children of the tag, throwing an exception when there is a non-string child." } ;
|
||||
|
||||
HELP: children-tags
|
||||
|
@ -86,5 +86,5 @@ HELP: tags-named
|
|||
{ $see-also deep-tag-named deep-tags-named tag-named } ;
|
||||
|
||||
HELP: get-id
|
||||
{ $values { "tag" "an XML tag or document" } { "id" "a string" } { "elem" "an XML element or f" } }
|
||||
{ $values { "tag" "an XML tag or document" } { "id" string } { "elem" "an XML element or f" } }
|
||||
{ $description "Finds the XML tag with the specified id, ignoring the namespace." } ;
|
||||
|
|
|
@ -24,12 +24,12 @@ ARTICLE: "xml.writer" "Writing XML"
|
|||
"All of these words operate on arbitrary pieces of XML: they can take, as in put, XML documents, comments, tags, strings (text nodes), XML chunks, etc." ;
|
||||
|
||||
HELP: xml>string
|
||||
{ $values { "xml" "an XML document" } { "string" "a string" } }
|
||||
{ $values { "xml" "an XML document" } { "string" string } }
|
||||
{ $description "This converts an XML document " { $link xml } " into a string. It can also be used to convert any piece of XML to a string, eg an " { $link xml-chunk } " or " { $link comment } "." }
|
||||
{ $notes "This does not preserve what type of quotes were used or what data was omitted from version declaration, as that information isn't present in the XML data representation. The whitespace in the text nodes of the original document is preserved." } ;
|
||||
|
||||
HELP: pprint-xml>string
|
||||
{ $values { "xml" "an XML document" } { "string" "a string" } }
|
||||
{ $values { "xml" "an XML document" } { "string" string } }
|
||||
{ $description "Converts an XML document into a string in a prettyprinted form." }
|
||||
{ $notes "This does not preserve what type of quotes were used or what data was omitted from version declaration, as that information isn't present in the XML data representation. The whitespace in the text nodes of the original document is preserved." } ;
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
USING: alien.accessors alien.c-types alien.libraries
|
||||
alien.syntax arrays byte-arrays compiler cpu.x86
|
||||
debugger definitions eval help.markup help.syntax io io.backend
|
||||
kernel libc math parser quotations sequences system ;
|
||||
alien.syntax byte-arrays cpu.x86 eval help.markup help.syntax io
|
||||
io.backend kernel math quotations sequences system ;
|
||||
IN: alien
|
||||
|
||||
HELP: cdecl
|
||||
|
@ -41,11 +40,11 @@ HELP: dll
|
|||
{ $class-description "The class of native library handles. See " { $link "syntax-aliens" } " for syntax and " { $link "dll.private" } " for general information." } ;
|
||||
|
||||
HELP: dll-valid?
|
||||
{ $values { "dll" dll } { "?" "a boolean" } }
|
||||
{ $values { "dll" dll } { "?" boolean } }
|
||||
{ $description "Returns true if the library exists and is loaded." } ;
|
||||
|
||||
HELP: expired?
|
||||
{ $values { "c-ptr" c-ptr } { "?" "a boolean" } }
|
||||
{ $values { "c-ptr" c-ptr } { "?" boolean } }
|
||||
{ $description "Tests if the alien is a relic from an earlier session. A byte array is never considered to have expired, whereas passing " { $link f } " always yields true." } ;
|
||||
|
||||
HELP: <bad-alien>
|
||||
|
@ -53,7 +52,7 @@ HELP: <bad-alien>
|
|||
{ $description "Constructs an invalid alien pointer that has expired." } ;
|
||||
|
||||
HELP: <displaced-alien>
|
||||
{ $values { "displacement" "an integer" } { "c-ptr" c-ptr } { "alien" "a new alien" } }
|
||||
{ $values { "displacement" integer } { "c-ptr" c-ptr } { "alien" "a new alien" } }
|
||||
{ $description "Creates a new alien address object, wrapping a raw memory address. The alien points to a location in memory which is offset by " { $snippet "displacement" } " from the address of " { $snippet "c-ptr" } "." }
|
||||
{ $notes "Passing a value of " { $link f } " for " { $snippet "c-ptr" } " creates an alien with an absolute address; this is how " { $link <alien> } " is implemented."
|
||||
$nl
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
USING: help.markup help.syntax kernel classes classes.private words
|
||||
checksums checksums.crc32 sequences math ;
|
||||
USING: classes classes.private help.markup help.syntax kernel
|
||||
math sequences ;
|
||||
IN: classes.algebra
|
||||
|
||||
ARTICLE: "class-operations" "Class operations"
|
||||
|
@ -45,7 +45,7 @@ HELP: flatten-class
|
|||
{ $description "Outputs a set of builtin and tuple classes whose union is the smallest cover of " { $snippet "class" } "." } ;
|
||||
|
||||
HELP: class<=
|
||||
{ $values { "first" "a class" } { "second" "a class" } { "?" "a boolean" } }
|
||||
{ $values { "first" "a class" } { "second" "a class" } { "?" boolean } }
|
||||
{ $description "Tests if all instances of " { $snippet "class1" } " are also instances of " { $snippet "class2" } "." }
|
||||
{ $notes "Classes are partially ordered. This means that if " { $snippet "class1 <= class2" } " and " { $snippet "class2 <= class1" } ", then " { $snippet "class1 <= class2" } ". Also, if " { $snippet "class1 <= class2" } " and " { $snippet "class2 <= class3" } ", then " { $snippet "class1 <= class3" } "." } ;
|
||||
|
||||
|
@ -62,7 +62,7 @@ HELP: class-and
|
|||
{ $description "Outputs the largest anonymous class contained in both " { $snippet "class1" } " and " { $snippet "class2" } "." } ;
|
||||
|
||||
HELP: classes-intersect?
|
||||
{ $values { "first" class } { "second" class } { "?" "a boolean" } }
|
||||
{ $values { "first" class } { "second" class } { "?" boolean } }
|
||||
{ $description "Tests if two classes have a non-empty intersection. If the intersection is empty, no object can be an instance of both classes at once." } ;
|
||||
|
||||
HELP: smallest-class
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
USING: help.markup help.syntax kernel kernel.private
|
||||
namespaces sequences words arrays effects math
|
||||
classes.private classes.union classes.mixin
|
||||
classes.predicate quotations ;
|
||||
USING: classes.private help.markup help.syntax kernel quotations
|
||||
sequences words ;
|
||||
IN: classes
|
||||
|
||||
ARTICLE: "class-predicates" "Class predicate words"
|
||||
|
@ -87,7 +85,7 @@ HELP: update-map
|
|||
{ $var-description "Assoc mapping each class to a set of classes defined in terms of this class. The " { $link define-class } " word uses this information to update generic words when classes are redefined." } ;
|
||||
|
||||
HELP: predicate-word
|
||||
{ $values { "word" "a word" } { "predicate" "a predicate word" } }
|
||||
{ $values { "word" word } { "predicate" "a predicate word" } }
|
||||
{ $description "Suffixes the word's name with \"?\" and creates a word with that name in the same vocabulary as the word itself." } ;
|
||||
|
||||
HELP: define-predicate
|
||||
|
@ -153,7 +151,7 @@ HELP: implementors
|
|||
HELP: instance?
|
||||
{ $values
|
||||
{ "object" object } { "class" class }
|
||||
{ "?" "a boolean" } }
|
||||
{ "?" boolean } }
|
||||
{ $description "Tests whether the input object is a member of the class." } ;
|
||||
|
||||
HELP: reset-class
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue