the magic behind "do it"

Bob Arning arning at charm.net
Thu Dec 27 15:49:10 UTC 2001


Brent,

The ReadWriteStream is a bit confused about how much there is available to read. Try this instead:

-----
| exprStream result failBlock |

exprStream _ ReadStream on: '1 + 2'.
failBlock _ [ Transcript show: 'ArithmeticExpression#eval FAILED: ', exprStream contents. ].
result _ Compiler new evaluate: exprStream in: nil to: nil notifying: nil ifFail: failBlock.
^ result

-----

Cheers,
Bob

On Thu, 27 Dec 2001 10:26:34 -0500 "Brent Vukmer" <bvukmer at blackboard.com> wrote:
>I wrote a script to
>access this method directly ( see below ).  I am getting nil instead of 3.  When I debugged, it looks like the Parser is generating the following MethodNode: 
>DoIt
>	^ nil
>
>What do I need to do to get Compiler-love?
>
>
>| exprStream result failBlock |
>
>exprStream  _ ReadWriteStream on: ''.
>exprStream nextPutAll: '1 + 2'.
>failBlock _ [ Transcript show: 'ArithmeticExpression#eval FAILED: ', exprStream contents. ].
>result _ Compiler new evaluate: exprStream in: nil to: nil notifying: nil ifFail: failBlock.
>^ result





More information about the Squeak-dev mailing list