[Pharo-project] non-interactive compiling with feedback

Milan Mimica milan.mimica at gmail.com
Mon Mar 19 14:22:50 EDT 2012


On 18 March 2012 23:20, Guillermo Polito <guillermopolito at gmail.com> wrote:

> Hmm, you can compile a method with Behavior>>#compile:notifying:
>
> and send an observer implementing:
>
> #notify:at:in:
>
> and some other stuff like #selection #deselect...
>
> That way you can capture the errors...
>

This almost works.
It doesn't raise errors for undeclared variables, instead it prompts for
variable replacement.

| method requestor |
requestor := Mock new.
(requestor stub: #selectionInterval) returns: (1 to: 2).
requestor stub: #selectFrom:to:.
(requestor stub: #bindingOf:) returns: nil.
(requestor stub: #notify:at:in:) will: [ self halt ].
method := Compiler new compiledMethodFor: 'a:=1' in: nil to: nil notifying:
requestor proxy ifFail: nil logged: false.
method inspect

I would like to catch the error. It is an error, right?


-- 
Milan Mimica
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20120319/88da528c/attachment-0001.html>


More information about the Pharo-dev mailing list