List Info

Thread: Weird behaviour with new syntax




Weird behaviour with new syntax
user name
2007-08-18 13:43:22
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/55b4491569c86b
a363b071479f17d67b.txt
into this:
   http://www.ta-sa.org/files/txt/a48fb056da620d
642b928beffa03fe66.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
help-smalltalkgnu.org

http://lists.gnu.org/mailman/listinfo/help-smalltalk

Re: Weird behaviour with new syntax
country flaguser name
Italy
2007-08-18 14:39:13
> 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
help-smalltalkgnu.org

http://lists.gnu.org/mailman/listinfo/help-smalltalk

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )