Blocks from strings

Nevin Pratt nevin at smalltalkpro.com
Thu Jan 1 23:44:54 UTC 2004


Avi Bryant wrote:

>
>
> This all sounds rather complicated, but anyway - am I correct in 
> understanding that you've got code doing something like
>
>    createBlockFor: selector
>    ^ self blockFromString: '[self session topView ', selector, ']'
>
> Why isn't that just
>
>    createBlockFor: selector
>    ^ [self session topView perform: selector]
>
> ?
>

I never got the "blocks from strings" code working inside of this 
Seaside context.  It worked fine attached to a test method of a test 
class, and seemed to capture the context of the test method just fine, 
but for some reason I couldn't get it to work inside of Seaside, within 
the WARenderer instance context.  Not sure exactly why (maybe it's the 
lose nut above the keyboard or something :-), but after that is when I 
realized that I really didn't need to get it working, because #perform: 
works just fine.  So, chalk one up to embarrassment, for not seeing that 
solution sooner.

As for your comment that "This all sounds rather complicated", yes I 
agree.  But I'm not sure how I can simplify it and still get all the 
features that it gives me (email-able URL's with multiple entry points 
into the app, auto-reconfiguration of the pages based on spider 
detection, etc.).

Nevin

-- 
Nevin Pratt
Bountiful Baby
http://www.bountifulbaby.com
(801) 992-3137





More information about the Squeak-dev mailing list