[Seaside-dev] Seeking comments on small (?) change to WAComponent

James Foster Smalltalk at JGFoster.net
Thu Feb 5 17:38:58 UTC 2009


On Feb 5, 2009, at 9:19 AM, Randal L. Schwartz wrote:

>>>>>> "James" == James Foster <Smalltalk at JGFoster.net> writes:
>
> James> renderContentOn: html
>
> James> 	canvas := html.
> James> 	self renderContent.
> James> 	canvas := nil.		"to allow GC"
>
> In fact, to be very clever, you could do this:
>
> renderContentOn: aCanvas
>
>   html := aCanvas. "inst var"
>   self renderContent.
>   html := nil.
>
> And now all of your previous html-ful methods still work... just
> remove the parameter. :)

I like it! Of course, this depends on your dialect of Smalltalk. I  
believe that some might object to adding an instance variable that  
overlaps an existing method argument or temp.

James

> -- 
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503  
> 777 0095
> <merlyn at stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
> Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
> See http://methodsandmessages.vox.com/ for Smalltalk and Seaside  
> discussion


More information about the seaside-dev mailing list