Andreas Rossberg wrote:
I disagree. That is a bogus analogy. An object pattern is completely
different from a 'let'. In particular, the latter binds 'mom', but not
'dad' and 'auntie'. The proper equivalence (I wouldn't call it a
duality)
Right. The duality I've cited is between
let o = {p: q};
and
let {p: q} = o;
where q and o change places.
Dave's suggestion of
let {p as q} = o;
does read better in my subjective opinion, even though it diverges the
pattern langauge (moreso; already diverged) from the object literal
language.
would be
let {unidentifiedAdult : mom as dad as auntie} = peopleComstants;
vs
let mom as dad as auntie = peopleComstants.unidentifiedAdult;
You cannot even express it without a compositional 'as'.
Agreed. But is it unthinkable to have 'as' (compositional of course) in
the pattern language only? I bow to your SuccessorML skills :-).
/be
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss