<br><font size=2 face="sans-serif">Hello Brent,</font>
<br>
<br><font size=2 face="sans-serif">the argument that follows the keyword evaluate: should not be a stream,</font>
<br><font size=2 face="sans-serif">but a string. &nbsp;Write </font>
<br>
<br><font size=2 face="Courier New">result _ Compiler new evaluate: exprStream contents</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; in: nil to: nil notifying: nil</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ifFail: failBlock. </font>
<br>
<br><font size=2 face="sans-serif">or simpler:</font>
<br>
<br><font size=2 face="Courier New">result _ Compiler new evaluate: ' 1 + 2 '</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; in: nil to: nil notifying: nil</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ifFail: failBlock. </font>
<br>
<br>
<br><font size=2 face="sans-serif">to get the expected result.</font>
<br>
<br>
<br>
<br>
<br><font size=2 face="sans-serif">Cheers,</font>
<br><font size=2 face="sans-serif">Boris Gärtner<br>
<br>
msg &nbsp;systems ag<br>
Fraunhoferstraße 9<br>
85737 Ismaning<br>
<br>
Tel.: (+89) 96 101 546<br>
mailto: Boris_Gaertner@msg.de</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td>
<td><font size=1 face="sans-serif"><b>&quot;Brent Vukmer&quot; &lt;bvukmer@blackboard.com&gt;</b></font>
<br><font size=1 face="sans-serif">Gesendet von: squeak-dev-admin@lists.squeakfoundation.org</font>
<p><font size=1 face="sans-serif">27.12.2001 16:26</font>
<br><font size=1 face="sans-serif">Bitte antworten an squeak-dev</font>
<br>
<td><font size=1 face="Arial">&nbsp; &nbsp; &nbsp; &nbsp; </font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; An: &nbsp; &nbsp; &nbsp; &nbsp;&lt;squeak-dev@lists.squeakfoundation.org&gt;</font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Kopie: &nbsp; &nbsp; &nbsp; &nbsp;</font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Thema: &nbsp; &nbsp; &nbsp; &nbsp;the magic behind &quot;do it&quot;</font></table>
<br>
<br>
<br><font size=2 face="Courier New">Selecting &quot;2 halt&quot; and inspecting brought me to the method Compiler#evalute:in:to:notifying:ifFail. &nbsp;I wrote a script to<br>
access this method directly ( see below ). &nbsp;I am getting nil instead of 3. &nbsp;When I debugged, it looks like the Parser is generating the following MethodNode: <br>
DoIt<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^ nil<br>
<br>
What do I need to do to get Compiler-love?<br>
<br>
<br>
| exprStream result failBlock |<br>
<br>
exprStream &nbsp;_ ReadWriteStream on: ''.<br>
exprStream nextPutAll: '1 + 2'.<br>
failBlock _ [ Transcript show: 'ArithmeticExpression#eval FAILED: ', exprStream contents. ].<br>
result _ Compiler new evaluate: exprStream in: nil to: nil notifying: nil ifFail: failBlock.<br>
^ result<br>
<br>
<br>
</font>
<br>
<br>