Both your variants are... strange... you use literal and create a new object
by passing it an already created object...

var xml:XML = <foo>{bar}</foo>;

This is how you'd normally do it. E4X uses couple of special opcodes
allocated only for it, so, my guess that using E4X expressions for
constructing XMLs should be the right way to do things. If you parse XML at
runtime, as opposed to the first way you bypass the compiler XML validation,
which is in generall a not smart thing to do... So, my guess that either
your test was somehow wrong, or, even if it was precise, then the benefit of
having compile time verification of XML structure would overweight in the
end. I don't believe the difference, even if not in favor of E4X may be that
big to consider reproducing it "by hand".

Reply via email to