On Wed, Jun 15, 2011 at 2:43 AM, Axel Rauschmayer <[email protected]> wrote:
> >> Has that been considered as a use case (e.g. after a
> compilation/generation step?). But it doesn’t seem like identifier names are
> accessible to quasi handlers, which would make this difficult.
> >
> > If the consensus ends up being that more than simple identifiers are
> > allowed in substitutions, then I don't know what it would mean for
> > identifiers to be available.
>
> I didn’t find in the spec how the "substitutions" parameter (that quasi
> handlers get) is structured, thus I assumed that it was an array of values.
> It could be an array of (key,value) pairs, then going beyond simple
> identifiers would be easy. I am assuming that order matters, if not, then
> there is something fundamental about handler parameters that I haven’t
> understood.
>
Doing this by default violates alpha rename-ability.
To ease lexing worries, we simplified the quasis proposal at the last minute
from accepting (informally)
Identifier `....${ Expression }....`
to
Identifier `....${ IdentifierDottedPathExpression }....`
Having now tried to write quasis within this restriction, I believe we chose
too strong a restriction at this last minute and need to find some way to
relax it. More on that later.
If we relax this position back towards Expression, then, if you want to pass
such pairs, you could do so:
foo`...${ {bar} }...${ {baz} }...`
Recall that {bar} will be syntactic sugar for {bar: bar}. So this would
expand to
foo(literalPartsRecord, {bar: bar}, {baz: baz})
>
> Using jQuery templates to validate template support: good choice, I really
> like this templating engine.
>
> Axel
>
> --
> Dr. Axel Rauschmayer
>
> [email protected]
> twitter.com/rauschma
>
> home: rauschma.de
> blog: 2ality.com
>
>
>
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
>
--
Cheers,
--MarkM
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss