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


Vocabulary
summary

Inputs and outputs
objectan object
stringa 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 bodies"
;


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
words>> first name>>
"More than one vocabulary defines a word named “" "”"
surround ;


USING: kernel sequences summary ;

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


USING: kernel summary ;

M: assert summary drop "Assertion failed" ;


USING: accessors assocs classes kernel make math.parser summary
;

M: assoc summary
[
dup class-of name>> % " with " % assoc-size #
" entries" %
] "" make ;


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 exactly one value"
;


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 sequences summary ;

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


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: 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-verify-error summary
drop "Certificate verification failed" ;


USING: generic kernel summary ;

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


USING: classes.mixin kernel summary ;

M: check-mixin-class-error summary drop "Not a mixin class" ;


USING: io.sockets.secure kernel summary ;

M: common-name-verify-error summary
drop "Common name verification failed" ;


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 summary
;

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


USING: grouping kernel summary ;

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


USING: kernel sequences summary ;

M: immutable summary drop "Sequence is immutable" ;


USING: graphviz.builder kernel summary ;

M: improper-statement-error summary
drop "Not a proper Graphviz statement" ;


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 than were input"
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: accessors io.serial math.parser sequences summary ;

M: invalid-baud summary
baud>> number>string "Baud rate " " not supported" surround
;


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 <inet6> instead"
;


USING: effects.parser kernel summary ;

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


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: 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: kernel lists.lazy summary ;

M: list-conversion-error summary
drop "Could not convert object to list" ;


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 stack-checker.errors summary ;

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


USING: concurrency.semaphores kernel summary ;

M: negative-count-semaphore summary
drop "Cannot have semaphore with negative count" ;


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: accessors alien.c-types prettyprint sequences summary ;

M: no-c-type summary
name>> unparse "“" "” is not a C type" surround ;


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: inverse kernel summary ;

M: no-inverse summary
drop "The word cannot be used in pattern matching" ;


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 peg.ebnf.private summary ;

M: no-tokenizer summary drop "Tokenizer not found" ;


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: graphviz.builder kernel summary ;

M: non-graph-error summary
drop "build-alien must be applied to the root graph" ;


USING: calendar kernel summary ;

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


USING: classes.tuple kernel summary ;

M: not-a-tuple summary drop "Not a tuple" ;


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 summary
drop
"Connection closed prematurely - potential truncation attack"
;


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: accessors classes kernel make math.parser sequences
summary ;

M: sequence summary
[ dup class-of name>> % " with " % length # " elements" % ]
"" make ;


USING: accessors help.lint.checks summary ;

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


USING: kernel sequences summary ;

M: slice-error summary drop "Cannot create slice" ;


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: 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: 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: 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 “"
"” don't match their expected effects"
] 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 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: 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-engine summary
drop "Unsupported layout engine; check supported-engines" ;


USING: graphviz.render kernel summary ;

M: unsupported-format summary
drop "Unsupported layout format; check supported-formats" ;


USING: kernel summary vocabs.metadata ;

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


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-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-summary % " (" % words>> assoc-size #
" words)" %
] "" make ;


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" ;