]> gitweb.factorcode.org Git - factor.git/blob - core/generic/single/single-docs.factor
core: trim using lists with tool
[factor.git] / core / generic / single / single-docs.factor
1 USING: help.markup help.syntax kernel math math.parser ;
2 IN: generic.single
3
4 HELP: no-method
5 { $values { "object" object } { "generic" "a generic word" } }
6 { $description "Throws a " { $link no-method } " error." }
7 { $error-description "Thrown by the " { $snippet "generic" } " word to indicate it does not have a method for the class of " { $snippet "object" } "." } ;
8
9 HELP: inconsistent-next-method
10 { $error-description "Thrown by " { $link POSTPONE: call-next-method } " if the values on the stack are not compatible with the current method." }
11 { $examples
12     "The following code throws this error:"
13     { $code
14         "GENERIC: error-test ( object -- )"
15         ""
16         "M: string error-test print ;"
17         ""
18         "M: integer error-test number>string call-next-method ;"
19         ""
20         "123 error-test"
21     }
22     "This results in the method on " { $link integer } " being called, which then passes a string to " { $link POSTPONE: call-next-method } ". However, this fails because the string is not compatible with the current method."
23     $nl
24     "This usually indicates programmer error; if the intention above was to call the string method on the result of " { $link number>string } ", the code should be rewritten as follows:"
25     { $code "M: integer error-test number>string error-test ;" }
26 } ;