Weird behaviour with new syntax

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Weird behaviour with new syntax

Robin Redeker-2
Hi!

I've converted my sources to the new syntax, and I ran into following
problem: gst-convert adds Eval [] around everything, but with Eval
following thing happens when I fileIn something:

   ~/devel/git/PRelay# cat Case.st
   Object subclass: Case [ ]

   ~/devel/git/PRelay# gst
   GNU Smalltalk ready

   st> Eval [ FileStream fileIn: 'Case.st'. Case new ]
   Object: nil error: did not understand #new
   MessageNotUnderstood(Exception)>>#signal
   UndefinedObject(Object)>>#doesNotUnderstand:
   UndefinedObject>>#executeStatements
   nil
   st> Eval [ FileStream fileIn: 'Case.st'. Case new ]
   a Case
   st>

The declaration or association of 'Case' doesn't exist in that first Eval.

The problem is that gst-convert converted this code:
   http://www.ta-sa.org/files/txt/55b4491569c86ba363b071479f17d67b.txt
into this:
   http://www.ta-sa.org/files/txt/a48fb056da620d642b928beffa03fe66.txt

S11001001 in IRC told me that I can't expect Logger (or 'Case' above) to be
defined in the same Eval. I sadly lack knowledge here about the workings of
smalltalk to know what to expect and when :-)


Robin


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Weird behaviour with new syntax

Paolo Bonzini

> The declaration or association of 'Case' doesn't exist in that first Eval.

Ah, I see!  Case is seen as a temporary variable and thus declared
elsewhere than in Undeclared.  Can be fixed by compiling each statement
separately inside Evals.

Paolo


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk