[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sc-devel] enhancement: Have the compiler throw an error instead of just halting

2008/1/10, James Harkins <jamshark70@xxxxxxxxx>:
>  but it occurs to
> me that there might be other cases where you might be compiling code
> programmatically, you don't have strict control over what that code
> is, and you might want to catch compilation errors instead of watch
> your app die.

You may have overlooked String.interpret? I use this in my code: I
have a GUI where I can edit the synth graph code in a document window
and have it automatically update a NodeProxy, just like this:

comp = str.interpret;
if(comp.isNil.not, {
	// push comp to the NodeProxy

If str doesn't compile, an error msg goes to the post window (IIRC)
but program flow continues with the result being nil, hence the