Advice (programming): Difference between revisions

Content deleted Content added
Rescuing 1 sources and tagging 0 as dead. #IABot (v2.0beta9)
https://web.archive.org/web/20060913001624/, WP:EXPLNOTE
Line 13:
"Advising" found its way into [[BBN Lisp]] and later into [[Xerox PARC]]'s [[Interlisp]].
 
It also found its way to [[Flavors (programming language)|Flavors]], the first [[object-oriented programming|object-oriented]] extension to [[Lisp (programming language)|Lisp]] developed at [[MIT]]. They were subsumed under the notion of method combination. <ref>See, for example, AIM-602 at https://web.archive.org/web/20060913001624/http://www.ai.mit.edu/research/publications/browse/0600browse.shtml <sup/ref>[[#Notes{{efn|1]]</sup>name=fn1}}
 
Since method combination and macros are closely related, it's also interesting to note that the first macro system was described in 1963, three years before Warren Teitelman's PhD thesis. <ref>See AIM-57 at https://web.archive.org/web/20060913001624/http://www.ai.mit.edu/research/publications/browse/0000browse.shtml <sup/ref>[[#Notes{{efn|2]]</sup>name=fn2}}
 
==Use==
Line 25:
(defadvice ispell (after advice)
(flyspell-buffer))
(ad-activate 'ispell t)
</source>
 
==Notes==
[[Gregor Kiczales]] comments the above as follows:
# Advice appeared separately from [[Flavors (Lisp)|Flavors]] in [[Maclisp]] and the [[Lisp Machine]]. You could advise any function, just like in Interlisp at the time. The before/after ontology appeared separately in Flavors methods.
# Method combination and macros were only marginally related until much later, in New Flavors and [[CLOS]], when a macro-like mechanism was provided to allow people to define their own rules for combining methods. Prior to that the rules governing combination of before/after methods and so-called whoppers methods (around) was fixed, and the compiler just generated the code for that. There were things called wrappers, which had macro-like behavior, but I forget when they came around. Traipsing through the various versions of MacLisp and Lispm manual to get this part of the history exactly right could interesting. Or it could be that Howard Cannon or David Moon or someone could actually remember it all exactly.
 
==Implementations==
Line 44 ⟶ 40:
* [[Python syntax and semantics#Decorators|Function decorator]] (w.r.t. [[Python (programming language)|Python]])
* [[Aspect-oriented software development#Advice bodies]]
 
==Notes==
[[Gregor Kiczales]] comments the above as follows:
{{notelist|refs=
# {{efn|name=fn1|Advice appeared separately from [[Flavors (Lisp)|Flavors]] in [[Maclisp]] and the [[Lisp Machine]]. You could advise any function, just like in Interlisp at the time. The before/after ontology appeared separately in Flavors methods.}}
# {{efn|name=fn2|Method combination and macros were only marginally related until much later, in New Flavors and [[CLOS]], when a macro-like mechanism was provided to allow people to define their own rules for combining methods. Prior to that the rules governing combination of before/after methods and so-called whoppers methods (around) was fixed, and the compiler just generated the code for that. There were things called wrappers, which had macro-like behavior, but I forget when they came around. Traipsing through the various versions of MacLisp and Lispm manual to get this part of the history exactly right could interesting. Or it could be that Howard Cannon or David Moon or someone could actually remember it all exactly.}}
}}
 
==References==