Doesn't compile in Flash CS4 Professional

72 views
Skip to first unread message

iki_xx

unread,
Jan 25, 2011, 3:36:34 PM1/25/11
to as3-signals
I can't compile the latest version downloaded from gitHub (0.8)
If I use the swc it works , but compiling against the source it
doesn't.

Errors:
Signal.as:150: 1049: Illegal assignment to a variable specified as
constant.
Signal.as:158: 1049: Illegal assignment to a variable specified as
constant.
Signal.as:159: 1049: Illegal assignment to a variable specified as
constant.

iki_xx

unread,
Feb 2, 2011, 9:40:55 AM2/2/11
to as3-signals
Anyone?

Stray

unread,
Feb 2, 2011, 9:53:29 AM2/2/11
to as3-s...@googlegroups.com
Flash IDE compiler and the MXMLC compiler aren't the same. Flash IDE won't allow const in the block.

The solution is just to use the swc.

Robert Penner

unread,
Feb 2, 2011, 11:06:07 AM2/2/11
to as3-s...@googlegroups.com
I am debating whether to change the local constants back to vars so it
will compile in Flash CS4. It's not hard to do.
However, Flash CS4's compiler is annoying. This isn't the first time
I've had to change Signals source because of it.
There is always the SWC option. Also, Flash CS5 can compile from source.

Thoughts? Am I leaving people behind unnecessarily by making them use
a SWC for CS4?

Robert

Simon Richardson

unread,
Feb 2, 2011, 11:14:03 AM2/2/11
to as3-s...@googlegroups.com
I personally prefer constants, as it gives you compile time checking against re-assigning values and can help prevent simple errors/bugs. I know it's classed as syntax sugar by the compilers as it seems they get converted to the same bytecode as var[1].

Also I think it helps with readability, but that's my personal opinion.

si

[1] http://jacksondunstan.com/articles/889

Stray

unread,
Feb 2, 2011, 11:16:39 AM2/2/11
to as3-s...@googlegroups.com
I can't imagine a scenario in which you need to compile from source in Flash CS4 and the swc isn't a suitable alternative.

Do we know whether CS4 gives priority to the swc or the raw source?

Personally I just now make sure I have both available - I like source for code completion in textmate etc, but I can use the swc when I need to use the IDE to compile.

There are other differences - the new abbreviated Vector syntax doesn't work in CS4 either, so I'm acclimatising to the need for workarounds.

On 2 Feb 2011, at 16:06, Robert Penner wrote:

Tyler Wright

unread,
Feb 2, 2011, 12:02:13 PM2/2/11
to as3-s...@googlegroups.com
I don't see the need for local consts, as local is an internal (controlled) scope. Const's are ideal for public API's to communicate external usage.

If that's the only blocker to compiling from CS4 then why hold on to it?

Tyler

Robert Penner

unread,
Feb 2, 2011, 9:33:03 PM2/2/11
to as3-s...@googlegroups.com
> I don't see the need for local consts, as local is an internal (controlled) scope.

If a value is not intended to change within the function, it's
advantageous to communicate the intent with const and guarantee that
it won't change. For me, it's inspired by functional programming and
Scala where immutability is highly sought after. Scala has var
declarations much like AS (but with type inference). But Scala also
has val (with an L) declarations, which cannot be changed after
assignment.

Robert

Josh Iverson

unread,
Feb 2, 2011, 10:42:05 PM2/2/11
to as3-s...@googlegroups.com
Completely agree with Robert I had this exact conversation with a peer recently and it's the intent.

Sent from my iPhone

Reply all
Reply to author
Forward
0 new messages