Lines Matching full:method

27 \ access method
37 \ The NEW method creates and initializes an instance of a class.
52 \ has an extra field for the vtable method count. Hasvtable declares
55 \ Revised Nov 2001 - metaclass debug method now finds only metaclass methods
59 \ END-CLASS allocates and clears the vtable - then it walks class's method
60 \ list and inserts all new methods into table. For each method, if the table
61 \ slot is already nonzero, do nothing (overridden method). Otherwise fill
70 \ : is redefined to check for override, fill in vtable index, increment method
84 \ Compile the method name, and code to find and
89 \ compiles a method name so that it pushes
92 : parse-method \ name run: ( -- c-addr u )
99 : (lookup-method) { class 2:name -- class 0 | class xt 1 | class xt -1 }
105 \ takes a counted string method name from the stack (as compiled
106 \ by parse-method) and attempts to look this method up in the method list of
108 \ and pushes the xt of the method. If not, it aborts with an error message.
110 : lookup-method { class 2:name -- class xt }
111 class name (lookup-method) ( 0 | xt 1 | xt -1 )
119 : find-method-xt \ name ( class -- class xt )
120 parse-word lookup-method
123 : catch-method ( instance class c-addr u -- <method-signature> exc-flag )
124 lookup-method catch
127 : exec-method ( instance class c-addr u -- <method-signature> )
128 lookup-method execute
131 \ Method lookup operator takes a class-addr and instance-addr
132 \ and executes the method from the class's wordlist if
137 find-method-xt execute
139 parse-method postpone exec-method
143 \ Method lookup with CATCH in case of exceptions
146 find-method-xt catch
148 parse-method postpone catch-method
152 \ METHOD makes global words that do method invocations by late binding
155 \ method next
156 \ method prev
159 : method create does> body> >name lookup-method execute ;
164 \ Early binding operator compiles code to execute a method
175 : => \ c:( class meta -- ) run: ( -- ??? ) invokes compiled method
176 drop find-method-xt compile, drop
179 : my=> \ c:( -- ) run: ( -- ??? ) late bind compiled method of current-class
183 \ Problem: my=[ assumes that each method except the last is am obj: member
193 lookup-method ( class xt )
210 \ The metaclass SUB method, defined below, leaves the address
318 \ See resume-class (a metaclass method) below for usage
329 \ Makes a class method that contains the code for an
331 \ the wordlist of every class by the SUB method.
492 \ This method leaves the stack and search order ready for instance variable
520 \ the name of in instance variable method, you get garbage
523 drop find-method-xt nip >body @ ;
550 \ decompile an instance method
554 \ debug a method of metaclass
555 \ Eg: my-class --> debug my-method
557 find-method-xt debug-xt ;
566 \ ** SUBCLASS is a nickname for a class's SUB method...
568 \ This method is late bound for safety...
603 \ default INIT method zero fills an instance
616 class s" init" lookup-method to &init
617 s" next" lookup-method to &next
680 find-method-xt debug-xt ;