]> gitweb.factorcode.org Git - factor.git/commitdiff
Update docs for lookup-method.
authorDoug Coleman <doug.coleman@gmail.com>
Mon, 3 Oct 2011 22:55:53 +0000 (15:55 -0700)
committerDoug Coleman <doug.coleman@gmail.com>
Mon, 3 Oct 2011 22:55:53 +0000 (15:55 -0700)
core/generic/generic-docs.factor
core/generic/generic.factor

index c9673a95b8fec75f071f2226cebaecb5f50e97dd..9af2805313d5d1cd721811a3eb87ffad19fb1195 100644 (file)
@@ -39,7 +39,7 @@ $nl
 "Methods can be added to existing generic words:"
 { $subsections create-method }
 "Method definitions can be looked up:"
-{ $subsections method }
+{ $subsections lookup-method ?lookup-method }
 "Finding the most specific method for an object:"
 { $subsections effective-method }
 "A generic word contains methods; the list of methods specializing on a class can also be obtained:"
@@ -131,12 +131,18 @@ HELP: M\
 { $class-description "Pushes a method on the stack." }
 { $examples { $code "M\\ fixnum + see" } { $code "USING: ui.gadgets.editors ui.render ;" "M\\ editor draw-gadget* edit" } } ;
 
-HELP: method
+HELP: lookup-method
+{ $values { "class" class } { "generic" generic } { "method" method } }
+{ $description "Looks up a method definition." }
+{ $class-description "The class of method bodies, which are words with special word properties set." }
+{ $errors "Throws an error if the method does not exist." } ;
+
+HELP: ?lookup-method
 { $values { "class" class } { "generic" generic } { "method/f" { $maybe method } } }
 { $description "Looks up a method definition." }
 { $class-description "The class of method bodies, which are words with special word properties set." } ;
 
-{ method create-method POSTPONE: M: } related-words
+{ lookup-method ?lookup-method create-method POSTPONE: M: } related-words
 
 HELP: <method>
 { $values { "class" class } { "generic" generic } { "method" "a new method definition" } }
index c360067fa3bb2cdb2e8144a1f68f0c40db8bf46a..03fb1115debd35b0c2e21d0d94eb91f2983527be 100644 (file)
@@ -30,7 +30,7 @@ ERROR: method-lookup-failed class generic ;
 : ?lookup-method ( class generic -- method/f )
     "methods" word-prop at ;
 
-: lookup-method ( class generic -- method/* )
+: lookup-method ( class generic -- method )
     2dup ?lookup-method [ 2nip ] [ method-lookup-failed ] if* ;
 
 <PRIVATE