Re: variable initializer circularity needs to be defined

This is a known issue raised by a few people, and is already on our 
issues list as issue qt-2004Feb1159-01. Here's the original post:

http://lists.w3.org/Archives/Public/public-qt-comments/2004Feb/1159.html

It has not yet been closed.

Jonathan


Per Bothner wrote:
> 
> In 4.12 "Variable Declaration" we have:
> 
>   If an initializing expression cannot be evaluated because of a
>   circularity (for example, it depends on a function that in turn
>   depends on the value of the variable that is being initialized),
>   a static error is raised.
> 
> I assume "circularity" will be defined somewhere, perhaps in the
> formal semantics?
> 
> Is the following a circularity?  (I would assume so, if it is
> to be statically detected.)
> 
> module namespace a = "A";
> import module namespace b = "B";
> declare variable a:x := b:y;
> 
> module namespace b = "B";
> import module namespace a = "A";
> declare variable b:y := if (true()) then 0 else a:x;
> 
> Is this a circularity?  (I assume not.)
> 
> module namespace a = "A";
> import module namespace b = "B";
> declare variable a:x := b:y;
> 
> module namespace b = "B";
> import module namespace a = "A";
> declare variable b:z := a:x;
> declare variable b:y := 0;

Received on Thursday, 12 August 2004 19:36:25 UTC