Hi Anthony,

Anthony Borla writes:
 > Greetings,
 > 
 > I'd hoped to not have to post a query about a syntax-related problem, but,
 > alas, here is one which has me stumped. The following code [packaged as a
 > single '.oz' file]:
 > 
 >     functor
 >     import
 >         System Application
 >     define
 >         fun {TestCount}
 >             local Count in
 >                 Count = {NewCell 0}
 >                 Count := @Count + 1
 >                 @Count
 >             end
 >         end
 >     in
 >         {System.printInfo "\n"#{TestCount}}
 >         {Application.exit 0}
 >     end
 > 
 > fails to compile, issuing the following diagnostics:
 > 
 > Mozart Compiler 1.2.5 (20030214) playing Oz 3
 > 

This is your problem.  The uniform syntax for state was introduced in
version 1.3.0 of Mozart.  Prior to that the := operator only worked
for disctionaries and arrays, and the @ operator only applied to
object attributes.

You program works fine with recent versions of Mozart/Oz.

Can you install a later version of Mozart?

 > %%% feeding file cell2.oz
 > 
 > %************************** syntax error ******
 > %**
 > %** expected dot expression to the left of :=
 > %**
 > %** in file "./cell2.oz", line 8, column 22
 > 
 > %************************* expansion error ****
 > %**
 > %** attribute access used outside of method
 > %**
 > %** in file "./cell2.oz", line 8, column 25
 > 
 > %************************* expansion error ****
 > %**
 > %** attribute access used outside of method
 > %**
 > %** in file "./cell2.oz", line 9, column 16
 > %** ------------------ rejected (3 errors)
 > 
 > Now, to be quite honest, I don't see the error in the code ! What could I
 > have missed, or done wrong ?
 > 
 > Cheers,
 > 
 > Anthony Borla
 > 
 > P.S.
 > 
 > If this is not the appropriate forum for such queries [I suspect that it
 > isn't, but am not aware of any other Oz-language forums, so have little
 > choice but to post here] could I please be directed to the appropriate one ?
 > 

The users list *is* the appropriate forum for such queries.

regards
Kevin

_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to