On Sun, Jul 6, 2014 at 9:49 PM, Alex Harui <aha...@adobe.com> wrote:

> I certainly won't stop someone from trying to implement e4x in JS.  I
> think there may already be some attempts.  I think a significant number of
> folks use dot-path like Mark Kessler reported and so it will still be a
> porting challenge for folks to re-code to using functions.
>
> That's why it isn't on my priority list: if you're going to port your e4x
> dot-path expressions, it might just be better to go to JSON instead.


Switching from XML to JSON will require a server side change in most
scenarios.  That might not be an option for folks especially servers that
they don't have control over.

Thanks,
Om


>  I think any attempt to do e4x requires custom data objects with getters
> because there are many scenarios where it isn't clear to the compiler that
> you are compiling e4x.  For example, as the data property in an item
> renderer.
>
> -Alex
>
> On 7/5/14 11:41 PM, "Harbs" <harbs.li...@gmail.com> wrote:
>
> >I think it is.
> >
> >Partial E4X support is better than none. We could offer support for the
> >more verbose form. I imagine it should be possible to do some conversions
> >of our own when compiling as well.
> >
> >I'm not sure how to go about handling filters though.
> >
> >On Jul 5, 2014, at 9:29 AM, Alex Harui <aha...@adobe.com> wrote:
> >
> >> I've not looked to see if the compiler does that or the runtime.  I
> >>think
> >> it is the runtime isn't it?
> >>
> >> -Alex
> >>
> >> On 7/4/14 10:12 AM, "Gordon Smith" <gsmit...@hotmail.com> wrote:
> >>
> >>> I think this syntax is just sugar for more verbose function calls like
> >>>
> >>> trace(foo.children("is"))
> >>>
> >>> but the terse syntax is much nicer.
> >>>
> >>> - Gordon
> >>>
> >>> Sent from my iPad
> >>>
> >>>> On Jul 4, 2014, at 12:22 AM, "Alex Harui" <aha...@adobe.com> wrote:
> >>>>
> >>>> There are functions, but I've seen significant use of XML as an
> >>>> "Object".
> >>>> IMO it is what makes e4x possible: the dot-path lookup as below:
> >>>>
> >>>> Var foo:XML = <this><is><a name="test" /></is></this>
> >>>>
> >>>>
> >>>> Trace(foo.is);
> >>>> Trace(foo..a(@name=="test"));
> >>>> Trace(foo..test);
> >>>>
> >>>> But I could be wrong and there is some other way to handle this.
> >>>>
> >>>> -Alex
> >>>>
> >>>>> On 7/3/14 12:51 PM, "Harbs" <harbs.li...@gmail.com> wrote:
> >>>>>
> >>>>> Why does it need setter/getter? E4X is all functions isn't it?
> >>>>>
> >>>>> Yeah. JSON is generally a better way to go, but some APIs are still
> >>>>>XML
> >>>>> and then there's manipulation of XML documents (which I tend to do a
> >>>>> lot
> >>>>> of...)
> >>>>>
> >>>>>> On Jul 3, 2014, at 7:53 PM, Alex Harui <aha...@adobe.com> wrote:
> >>>>>>
> >>>>>> I took a quick look a while back.  Required getter/setter support in
> >>>>>> the
> >>>>>> browser.  And then the remaining question: will it perform?  It is
> >>>>>> similar
> >>>>>> to the AMF question.  Doable, but may not be faster than switching
> >>>>>>to
> >>>>>> JSON.
> >>>>>>
> >>>>>> -Alex
> >>>>>>
> >>>>>>> On 7/3/14 9:48 AM, "Harbs" <harbs.li...@gmail.com> wrote:
> >>>>>>>
> >>>>>>> Has anyone looked into writing a js library to copy the
> >>>>>>>functionality
> >>>>>>> of
> >>>>>>> E4X?
> >>>>>>>
> >>>>>>> It seems to me that at least 90% of E4X could be pretty easily
> >>>>>>> replicated
> >>>>>>> in a js libraryĆ 
> >>>>>>>
> >>>>>>> Besides namespaces, the only thing that seems hard to me is complex
> >>>>>>> selectors.
> >>>>>>>
> >>>>>>>> On Jul 2, 2014, at 7:53 PM, Alex Harui <aha...@adobe.com> wrote:
> >>>>>>>>
> >>>>>>>> FWIW, FlexJS is eventually going to need to find a way to warn
> >>>>>>>>folks
> >>>>>>>> about
> >>>>>>>> use of E4X
> >>>>>>>
> >>>>>>
> >>>>>
> >>>>
> >>
> >
>
>

Reply via email to