summary ( object -- string ) - Factor Documentation

summary ( object -- string )
Converting objects to summary strings


Vocabulary
summary

Inputs
object an object


Outputs
string a string


Generic word contract
Outputs a brief description of the object.

Notes
New methods can be defined by user code. Most often, this is used with error classes so that The debugger can print friendlier error messages.

Definition
IN: summary

GENERIC: summary ( object -- string )


Methods
USING: accessors alien.parser sequences summary ;

M: *-in-c-type-name summary
name>> "Cannot define a C type '"
"' that ends with an asterisk (*)" surround ;


USING: kernel locals.errors summary ;

M: :>-outside-lambda-error summary
drop ":> cannot be used outside of [let, [|, or :: forms" ;


USING: kernel locals.errors summary ;

M: >r/r>-in-lambda-error summary
drop
"Explicit retain stack manipulation is not permitted in lambda..."
;


USING: combinators effects io.streams.string namespaces
prettyprint prettyprint.backend prettyprint.config see
see.private summary words.alias ;

M: alias summary
[
0 margin set 1 line-limit set [
{
[ seeing-word ]
[ definer. ]
[ pprint-word ]
[ stack-effect pprint-effect ]
} cleave
] with-in
] with-string-writer ;


USING: destructors kernel summary ;

M: already-disposed summary
drop "Attempting to operate on disposed object" ;


USING: backtrack kernel summary ;

M: amb-failure summary drop "Backtracking failure" ;


USING: accessors sequences summary vocabs.parser ;

M: ambiguous-use-error summary
name>> "The name '" "' resolves to more than one word."
surround ;


USING: kernel sequences summary ;

M: assert-sequence summary drop "Assertion failed" ;


USING: kernel summary ;

M: assert summary drop "Assertion failed" ;


USING: continuations kernel summary ;

M: attempt-all-error summary drop "Nothing to attempt" ;


USING: alien.data kernel summary ;

M: bad-byte-array-length summary
drop "Byte array length doesn't divide type width" ;


USING: kernel summary words ;

M: bad-create summary drop "Bad parameters to create" ;


USING: effects.parser kernel summary ;

M: bad-effect summary drop "Bad stack effect declaration" ;


USING: heaps kernel summary ;

M: bad-heap-delete summary
drop "Invalid entry passed to heap-delete" ;


USING: kernel smalltalk.compiler.lexenv summary ;

M: bad-identifier summary drop "Unknown identifier" ;


USING: classes kernel summary ;

M: bad-inheritance summary
drop "Circularity in inheritance chain" ;


USING: kernel slots summary ;

M: bad-initial-value summary drop "Incompatible initial value" ;


USING: classes.tuple.parser kernel summary ;

M: bad-literal-tuple summary drop "Bad literal tuple" ;


USING: kernel locals.errors summary ;

M: bad-local summary
drop "You have found a bug in locals. Please report." ;


USING: accessors sequences stack-checker.errors summary ;

M: bad-macro-input summary
macro>> name>> "Cannot apply '"
"' to a run-time computed value" surround ;


USING: kernel parser summary ;

M: bad-number summary drop "Bad number literal" ;


USING: combinators.random.private kernel summary ;

M: bad-probabilities summary
drop
"The probabilities do not satisfy the rules stated in the docs."
;


USING: kernel libc summary ;

M: bad-ptr summary drop "Memory allocation failed" ;


USING: kernel locals.errors summary ;

M: bad-rewrite summary
drop "You have found a bug in locals. Please report." ;


USING: classes.tuple.parser kernel summary ;

M: bad-slot-name summary
drop "Bad slot name in object literal" ;


USING: kernel slots summary ;

M: bad-slot-value summary drop "Bad store to specialized slot" ;


USING: infix.private kernel summary ;

M: bad-stack-effect summary
drop
"Words used in infix must declare a stack effect and return ex..."
;


USING: classes.tuple kernel summary ;

M: bad-superclass summary
drop
"Tuple classes can only inherit from non-final tuple classes"
;


USING: kernel summary tr ;

M: bad-tr summary
drop "TR: can only be used with ASCII characters" ;


USING: kernel summary vocabs ;

M: bad-vocab-name summary
drop "Vocab name cannot contain ':/\\ \"'" ;


USING: kernel sequences summary ;

M: bounds-error summary drop "Sequence index out of bounds" ;


USING: kernel summary ulid ;

M: bytes>ulid-bad-length summary
drop "Invalid ULID byte-array length" ;


USING: alien kernel summary ;

M: callsite-not-compiled summary
drop "Caller not compiled with the optimizing compiler" ;


USING: kernel summary tools.annotations ;

M: cannot-annotate-twice summary
drop "Cannot annotate a word twice" ;


USING: kernel summary words ;

M: cannot-be-inline summary
drop "This type of word cannot be inlined" ;


USING: graphviz.render kernel summary ;

M: cannot-find-graphviz-installation summary
drop "Cannot find Graphviz installation" ;


USING: concurrency.messaging kernel summary ;

M: cannot-send-synchronous-to-self summary
drop "Cannot synchronous send to myself" ;


USING: io.sockets.secure kernel summary ;

M: certificate-missing-error summary
drop "Host did not present any certificate" ;


USING: io.sockets.secure kernel summary ;

M: certificate-verify-error summary
drop "Certificate verification failed" ;


USING: generic kernel summary ;

M: check-method-error summary
drop "Invalid parameters for create-method" ;


USING: accessors continuations summary ;

M: condition summary error>> summary ;


USING: io.encodings kernel summary ;

M: decode-error summary drop "Character decoding error" ;


USING: kernel summary tools.deprecation ;

M: deprecated-usages summary drop "Deprecated words used" ;


USING: kernel summary tools.test.private ;

M: did-not-fail summary drop "Did not fail" ;


USING: kernel summary units ;

M: dimensions-not-equal summary drop "Dimensions do not match" ;


USING: accessors sequences stack-checker.errors summary ;

M: diverging-recursion-error summary
word>> name>> "The recursive word '"
"' digs arbitrarily deep into the stack" surround ;


USING: kernel math.ratios summary ;

M: division-by-zero summary drop "Division by zero" ;


USING: accessors sequences stack-checker.errors summary ;

M: do-not-compile summary
word>> name>> "Cannot compile call to '" "'" surround ;


USING: classes.tuple.parser kernel summary ;

M: duplicate-slot-names summary drop "Duplicate slot names" ;


USING: accessors peg.ebnf.private sequences summary ;

M: ebnf-foreign-not-found summary
name>> "Foreign word '" "' not found" surround ;


USING: kernel stack-checker.errors summary ;

M: effect-error summary
drop "Stack effect declaration is wrong" ;


USING: io.encodings kernel summary ;

M: encode-error summary drop "Character encoding error" ;


USING: summary ;

M: f summary object-summary ;


USING: inverse kernel summary ;

M: fail summary drop "Matching failed" ;


USING: accessors kernel make math.parser sequences summary
tools.test.fuzz.private ;

M: fuzz-test-failure summary
[
"Fuzz test predicate failed for " %
dup failures>> length # " out of " % trials>> #
" trials" %
] "" make ;


USING: accessors gobject-introspection kernel sequences
splitting summary ;

M: gir-not-found summary
[ name>> "'" "' file not found on paths:\n" surround ]
[ paths>> join-lines ] bi
"\n\nUse the existing path or declare GIR_DIRS environment variable"
3append ;


USING: gopher.private present summary urls ;

M: gopher-link summary >url present ;


USING: grouping kernel summary ;

M: groups-error summary drop "Non positive group size" ;


USING: generators kernel summary ;

M: has-inputs summary
drop "Generator quotation cannot require inputs" ;


USING: kernel sequences summary ;

M: immutable summary drop "Sequence is immutable" ;


USING: generic.single kernel summary ;

M: inconsistent-next-method summary
drop
"Executing call-next-method with inconsistent parameters" ;


USING: accessors sequences stack-checker.errors summary ;

M: inconsistent-recursive-call-error summary
word>> name>> "The recursive word '"
"' calls itself with a different set of quotation parameters t..."
surround ;


USING: accessors classes kernel make prettyprint summary typed ;

M: input-mismatch-error summary
[
"Typed word '" % dup word>> name>> %
"' expected input value of type " %
dup expected-type>> unparse % " but got " %
dup value>> class-of name>> % drop
] "" make ;


USING: accessors io.styles kernel make splitting summary ;

M: input summary
[
"Input: " % string>> "\n" split1
[ % ] [ "..." "" ? % ] bi*
] "" make ;


USING: math summary ;

M: integer summary object-summary ;


USING: compression.bzip3 kernel summary ;

M: internal-error summary drop "bzip3: Internal Error" ;


USING: compression.bzip3 kernel summary ;

M: invalid-block-size summary
drop "Block size must be between 65 KiB and 511 MiB" ;


USING: io.sockets kernel summary ;

M: invalid-inet-server summary
drop
"Cannot use <server> with <inet>; use <inet4> or <inet6> instead"
;


USING: io.sockets.private kernel summary ;

M: invalid-ipv4 summary drop "Invalid IPv4 address" ;


USING: io.sockets.private kernel summary ;

M: invalid-ipv6 summary drop "Invalid IPv6 address" ;


USING: io.sockets kernel summary ;

M: invalid-local-address summary
drop
"Cannot use with-local-address with <inet>; use <inet4> or <in..."
;


USING: effects.parser kernel summary ;

M: invalid-row-variable summary
drop
"Stack effect row variables can only occur as the first input ..."
;


USING: classes.tuple.parser kernel summary ;

M: invalid-slot-name summary drop "Invalid slot name" ;


USING: io.backend.unix kernel summary ;

M: io-timeout summary drop "I/O operation timed out" ;


USING: json kernel summary ;

M: json-fp-special-error summary
drop "JSON serialization: illegal float:" ;


USING: kernel locals.errors summary ;

M: let-form-in-literal-error summary
drop "[let not permitted inside literals" ;


USING: accessors lexer summary ;

M: lexer-error summary error>> summary ;


USING: accessors help.topics kernel make prettyprint summary
words ;

M: link summary
[
"Link: " % name>> dup word?
[ summary ] [ unparse-short ] if %
] "" make ;


USING: infix.private kernel summary ;

M: local-not-defined summary drop "local is not defined" ;


USING: kernel locals.errors summary ;

M: local-writer-in-literal-error summary
drop "Local writer words not permitted inside literals" ;


USING: kernel mirrors summary ;

M: mirror-slot-removal summary
drop
"Slots cannot be removed from a tuple or a mirror of it" ;


USING: kernel stack-checker.errors summary ;

M: missing-effect summary
drop "Missing stack effect declaration" ;


USING: accessors formatting kernel math.matrices.extras
math.text.english summary ;

M: negative-power-matrix summary
n>> dup ordinal-suffix "%s%s power of a matrix is undefined"
sprintf ;


USING: help.topics kernel summary ;

M: no-article summary drop "Help article does not exist" ;


USING: biassocs kernel summary ;

M: no-biassoc-deletion summary
drop "biassocs do not support deletion" ;


USING: alien.c-types kernel summary ;

M: no-c-type summary drop "Not a C type" ;


USING: combinators kernel summary ;

M: no-case summary drop "Fall-through in case" ;


USING: combinators kernel summary ;

M: no-cond summary drop "Fall-through in cond" ;


USING: kernel summary vocabs.parser ;

M: no-current-vocab-error summary
drop "Not in a vocabulary; IN: form required" ;


USING: kernel match summary ;

M: no-match-cond summary drop "Fall-through in match-cond" ;


USING: inverse kernel summary ;

M: no-match summary drop "Fall through in switch" ;


USING: generic.math kernel summary ;

M: no-math-method summary drop "No suitable arithmetic method" ;


USING: generic.single kernel summary ;

M: no-method summary drop "No suitable method" ;


USING: generic kernel summary ;

M: no-next-method summary
drop "Executing call-next-method from least-specific method"
;


USING: kernel random summary ;

M: no-random-number-generator summary
drop "Random number generator is not defined" ;


USING: compiler.errors kernel summary ;

M: no-such-library summary drop "Library not found" ;


USING: kernel summary usa-cities ;

M: no-such-state summary drop "No such state" ;


USING: compiler.errors kernel summary ;

M: no-such-symbol summary drop "Symbol not found" ;


USING: kernel summary xml.syntax.private ;

M: no-tag summary
drop
"The tag-dispatching word has no method for the given tag name"
;


USING: kernel summary vocabs ;

M: no-vocab summary drop "Vocabulary does not exist" ;


USING: accessors sequences summary vocabs.parser ;

M: no-word-error summary
name>> "No word named '"
"' found in current vocabulary search path" surround ;


USING: accessors kernel make summary vocabs.parser ;

M: no-word-in-vocab summary
[ vocab>> ] [ word>> ] bi [
"No word named '" % % "' found in '" % %
"' vocabulary" %
] "" make ;


USING: accessors formatting kernel math.matrices.extras summary
;

M: non-square-determinant summary
[ m>> ] [ n>> ] bi
"non-square %s x %s matrix has no determinant" sprintf ;


USING: calendar.english kernel summary ;

M: not-a-month summary drop "Months are indexed starting at 1" ;


USING: kernel random summary ;

M: not-a-random-generator summary
drop "Object is not a random number generator" ;


USING: accessors compiler.errors sequences summary ;

M: not-compiled summary
word>> name>> "The word "
" cannot be executed because it failed to compile" surround
;


USING: accessors sequences summary vocabs.loader ;

M: not-found-in-roots summary
path>> "Cannot resolve vocab: " prepend ;


USING: generic.parser kernel summary ;

M: not-in-a-method-error summary
drop
"call-next-method can only be called in a method definition"
;


USING: kernel summary ;

M: object summary object-summary ;


USING: accessors classes kernel make summary typed ;

M: output-mismatch-error summary
[
"Typed word '" % dup word>> name>> %
"' expected to output value of type " %
dup expected-type>> name>> % " but gave " %
dup value>> class-of name>> % drop
] "" make ;


USING: db.postgresql.lib kernel summary ;

M: postgresql-result-null summary drop "PQexec returned f." ;


USING: io.sockets.secure kernel summary ;

M: premature-close-error summary
drop "Connection closed prematurely" ;


USING: kernel libc summary ;

M: realloc-error summary drop "Memory reallocation failed" ;


USING: kernel stack-checker.errors summary ;

M: recursive-quotation-error summary
drop "Recursive quotation" ;


USING: accessors peg.ebnf.private sequences summary ;

M: redefined-rule summary
name>> "Rule '" "' defined more than once" surround ;


USING: effects.parser kernel summary ;

M: row-variable-can't-have-type summary
drop
"Stack effect row variables cannot have a declared type" ;


USING: kernel sequences summary ;

M: sequence summary dup length "elements" container-summary ;


USING: accessors help.lint.checks summary ;

M: simple-lint-error summary message>> ;


USING: accessors combinators kernel math sequences summary ;

M: slice-error summary
"Cannot create slice" swap {
{ [ dup from>> 0 < ] [ ": from < 0" ] }
{
[ dup [ to>> ] [ seq>> length ] bi > ]
[ ": to > length" ]
}
{ [ dup [ from>> ] [ to>> ] bi > ] [ ": from > to" ] }
[ f ]
} cond nip append ;


USING: accessors source-files.errors summary ;

M: source-file-error summary error>> summary ;


USING: effects.parser kernel summary ;

M: stack-effect-omits-dashes summary
drop "Stack effect must contain '--'" ;


USING: kernel parser summary ;

M: staging-violation summary
drop
"A parsing word cannot be used in the same file it is defined in."
;


USING: kernel sequences strings summary ;

M: string summary dup length "code points" container-summary ;


USING: classes.struct kernel summary ;

M: struct-must-have-slots summary
drop "Struct definitions must have slots" ;


USING: accessors alien classes classes.struct kernel make
math.parser summary ;

M: struct summary
[
dup class-of name>> % " struct of " % byte-length #
" bytes " %
] "" make ;


USING: io.sockets.secure kernel summary ;

M: subject-name-verify-error summary
drop "Subject name verification failed" ;


USING: kernel stack-checker.errors summary ;

M: too-many->r summary
drop
"Quotation pushes elements on retain stack without popping them"
;


USING: kernel stack-checker.errors summary ;

M: too-many-r> summary
drop
"Quotation pops retain stack elements which it did not push"
;


USING: http http.client kernel make math.parser summary ;

M: too-many-redirects summary
drop
[ "Redirection limit of " % max-redirects # " exceeded" % ]
"" make ;


USING: accessors kernel make prettyprint summary
tools.trace.private ;

M: trace-step-state summary
[
[ "Word: " % word>> name>> % ]
[ " -- inputs: " % inputs>> unparse-short % ] bi
] "" make ;


USING: accessors sequences stack-checker.errors summary ;

M: transform-expansion-error summary
word>> name>> "Macro expansion of '" "' threw an error"
surround ;


USING: kernel summary ;

M: tuple summary tuple-summary ;


USING: kernel summary ulid ;

M: ulid-overflow summary
drop "Too many ULIDs generated per msec" ;


USING: kernel summary ulid ;

M: ulid>bytes-bad-character summary
drop "Invalid character in ULID" ;


USING: kernel summary ulid ;

M: ulid>bytes-bad-length summary drop "Invalid ULID length" ;


USING: kernel summary ulid ;

M: ulid>bytes-overflow summary drop "Overflow error in ULID" ;


USING: accessors kernel sequences stack-checker.errors summary ;

M: unbalanced-branches-error summary
[ word>> name>> ] [ quots>> length 1 = ] bi [
"The input quotation to '"
"' doesn't match its expected effect"
] [
"The input quotations to '"
"' do not all leave the stack at the same height"
] if surround ;


USING: accessors sequences stack-checker.errors summary ;

M: unbalanced-recursion-error summary
word>> name>> "The recursive word '"
"' leaves with the stack having the wrong height" surround ;


USING: accessors sequences stack-checker.errors summary ;

M: undeclared-recursion-error summary
word>> name>> "The inline recursive word '"
"' must be declared recursive" surround ;


USING: accessors kernel make math.derivatives math.parser
summary ;

M: undefined-derivative summary
[
dup "Derivative of " % word>> name>> %
" is undefined at " % point>> # "." %
] "" make ;


USING: accessors formatting kernel math.matrices.extras summary
;

M: undefined-inverse summary
[ m>> ] [ n>> ] [ r>> name>> ] tri
"%s x %s matrix of rank %s has no inverse" sprintf ;


USING: accessors kernel summary words ;

M: undefined-word summary
word>> undefined-word?
"Cannot execute a deferred word before it has been defined"
"Cannot execute a word before it has been compiled" ? ;


USING: accessors sequences stack-checker.errors summary ;

M: unknown-macro-input summary
macro>> name>> "Cannot apply '"
"' to an input parameter of a non-inline word" surround ;


USING: accessors kernel sequences summary tar ;

M: unknown-typeflag summary
ch>> [ "Unknown typeflag: " ] dip prefix ;


USING: help.lint.coverage.private kernel summary ;

M: unloaded-vocab summary drop "Not a loaded vocabulary" ;


USING: kernel summary vocabs.metadata ;

M: unsupported-architecture summary
drop "Current CPU not supported by this vocabulary" ;


USING: images.bitmap kernel summary ;

M: unsupported-bitfield-widths summary
drop
"Bitmaps only support bitfield compression in 16/32bit images"
;


USING: graphviz.render kernel summary ;

M: unsupported-encoding summary
drop
"Must use utf8 or latin1 (match the graph's charset attribute)"
;


USING: kernel summary vocabs.metadata ;

M: unsupported-platform summary
drop
"Current operating system not supported by this vocabulary"
;


USING: graphviz.render kernel summary ;

M: unsupported-preview-format summary
drop "Unsupported preview format" ;


USING: io.sockets.secure kernel summary ;

M: upgrade-buffers-full summary
drop
"send-secure-handshake can only be used if buffers are empty"
;


USING: io io.sockets.secure kernel summary ;

M: upgrade-on-non-socket summary
drop
"send-secure-handshake can only be used if input-stream and"
print "output-stream are a socket" ;


USING: kernel parser summary ;

M: version-control-merge-conflict summary
drop "Version control merge conflict in source code" ;


USING: debugger kernel summary ;

M: vm-error summary drop "VM error" ;


USING: help.topics help.vocabs summary ;

M: vocab-author summary article-title ;


USING: summary vocabs vocabs.metadata ;

M: vocab-link summary vocab-in-root-summary ;


USING: help.topics help.vocabs summary ;

M: vocab-tag summary article-title ;


USING: accessors assocs kernel make math.parser summary vocabs
vocabs.metadata ;

M: vocab summary
[
dup vocab-in-root-summary % " (" % words>> assoc-size #
" words)" %
] "" make ;


USING: help.lint.coverage help.lint.coverage.private
io.streams.string summary ;

M: word-help-coverage summary
[ (present-coverage) ] with-string-writer ; inline


USING: see summary words ;

M: word summary synopsis ;


USING: combinators kernel summary ;

M: wrong-values summary
drop "Quotation's stack effect does not match call site" ;

AltStyle によって変換されたページ (->オリジナル) /