[Seaside] input of uncompilable code error hags the session

Michael Roberts mike at mjr104.co.uk
Sat Oct 15 14:08:15 UTC 2005

Hi Sebastián,

a few quick thoughts.

>     [:e| e interested and:[ e surname notNil]]

If your query text always needs to be a block you could assemble the 
outer block syntax without making the user do it.  Something like

results := collection select: '[:each |', filter, ']'

It will simplify the filter a little.  You might want to tell the user 
that they have a variable 'each' in scope.

The next thing that springs to mind is that you should be able to trap 
any exceptions raised by your Compiler>>evaluate.

[Compiler evaluate: '1 zork']
on: XX
do: [:ex |]

You would probably want to do this anyway because anything untoward in 
the evaluate is going to pop out.

The next thing to mention is that this is a security hole.  You probably 
don't mind but if you didn't know, the evaluate can perform any side 
effect in your system.

The next thought is that you might want to look at the AST for the 
filter code.  By walking the program nodes you might be able to figure 
out if the code is going to compile.  This analysis is not the easiest 
but you might be able to spot something obvious.



More information about the Seaside mailing list