>I believe it's type * so you should cast it.

This has nothing to do with that, hehe. There is a tiny difference beween
ClassToCastTo(value) and (value as ClassToCastTo). In the first case a
compiler error will be thrown. In the second case the cast will be tried. If
it fails the resulting value will be a null value.

>why is -it- working

The pop method is typed as Object. Object is a dynamic class which means you
can add properties at
runtime. This in turn means that the compiler can not complain about
you calling a property that might not exist as you might be adding it
'dynamically' before you call it,


Greetz Erik


On 1/12/08, Mark Winterhalder <[EMAIL PROTECTED]> wrote:
>
> On Jan 11, 2008 11:34 PM, Mark Lapasa <[EMAIL PROTECTED]> wrote:
> > I too would expect that it would need to be casted.
>
> Yes, one would think so.
>
> I can't answer your question, either, but can't help but note that in
> haXe you would declare your array as Array<MyClass>. The compiler
> wouldn't let you put anything else into it, and likewise, everything
> you'd pull out would be of type MyClass. haXe has a great type system
> (including implied types and type templates), so if you're the kind of
> coder that wonders about issues like that, I recommend you have a llok
> at <http://haxe.org>.
>
> Mark
> _______________________________________________
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to