incubator-flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Сергей aSt Егоров <bsid...@gmail.com>
Subject Re: [jira] [Updated] (FLEX-51) Please check support for ExactValue initializer
Date Tue, 24 Apr 2012 15:49:21 GMT
I didn't see anything bad when you use ${} to work with a non const
values, because it's created exactly for this flow (when we needs
evaluate some expression once, without binding)

On Tue, Apr 24, 2012 at 7:43 PM, Justin Mclean <justin@classsoftware.com> wrote:
> Hi,
>
>> If so, why do we want to add syntax instead of having the compiler figure out that
the value will
>> never change?
> That would be ideal but probably much more complex to implement than this patch. It may
also we hard to work out if an expression as opposed to a variable is "constant" or not.
>
> I'm not sure the MXML compiler (at this stage of compilation) can even work if the value
will actually change or not? Anyone know?
>
>>  If not, how will you know when to assign the value?
> I think it would safe to assume that it's the initial assigned value. The intended use
case (correct me here if I wrong) would be generally along the lines of:
>
> public static const WIDTH:int = 200;
>
> <s:List width="${WIDTH}" height="${WIDTH/2}" />
>
> Might be a good idea to issue a compiler warning if you $ bind to a non const variable
or expression but not stop you from doing that.
>
> Thanks,
> Justin
>



-- 
С уважением, Сергей Егоров

Mime
View raw message