[squeak-dev] Re: Object>>#is:? (was: Re: PackageDependencyTest)

Stéphane Rollandin 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
> code.

I actually use this to find function senders in my lisp code (see 
http://www.zogotounga.net/comp/squeak/lispkit.htm for details).
example:


ULisp>>slibIntegration

	"transparently using SLIB"

	^#(in-library slib-integration

(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))
			(require `pretty-print)
			(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 :)

Stef





More information about the Squeak-dev mailing list