[squeak-dev] Re: Object>>#is:? (was: Re: PackageDependencyTest)
lecteur at zogotounga.net
Thu Mar 4 21:32:10 UTC 2010
> Using senders to find methods having to do with symbols that mean, for
> example, a possible aspect or status of some object, is a pretty
> standard practice. See for example senders of
> #messageCategorySelectionChanged, #errorOnStep, #doesButtonAction. Of
> course, the symbol being there is not enough. You also need to read the
I actually use this to find function senders in my lisp code (see
http://www.zogotounga.net/comp/squeak/lispkit.htm for details).
"transparently using SLIB"
(defun display-source (symbol)
'Display the source code for the procedure bound to SYMBOL
This can be either Lisp or Smalltalk code'
(let ((proc (symbol-function symbol)))
(if (#'primitive?' symbol)
(display (procedure-source proc))
(pretty-print (procedure-source proc)))))
the above code can be seen as a smart trick, or as a real ugly abusive
hack. depends on taste, again :)
More information about the Squeak-dev