linkedin/dustjs — pull request #261 by mickeyreiss (2013-04-12 20:06:12+00:00)
Title: Inconsistent syntax for partials with dynamic names and context

Hey guys, I noticed some inconsistencies in the syntax for invoking partials with dynamic names and a scope.

Let's say this is my *scope*:
```javascript
{
me: { name: Mickey, company: "Medallia" },
partialName: "person"
}
```

And this is a *partial* that I've got saved in person.dust:
```dust
Hi, I'm {name}, and you can find me at {company}!
```

Here's where the problems begin. This is my *template*:
```dust
{#me}
{> person /}
{/me}
{?me}
{> person:me /}
{/me}
{?me}
{> person name=me.name company=me.company /}
{/me}

{! So far so good... !}

{#me}
{> "{partialName}" /} {! <-- This works !}
{/me}
{?me}
{> "{partialName}":me /} {! <-- This throws a template "[blank]" not found error !}
{/me}
{?me}
{> "{partialName}" name=me.name company=me.company /} {! <-- and this one also throws an error :( !}
{/me}
```
I would expect this to output "Hi, I'm Mickey, and you can find me at Medallia!" six times. However, the last two partial invokations throw errors.

My understanding is that this behavior is inconsistent. I've added some specs that are currently failing, and I think they should be fulfilled.

Do you guys agree? Is there a rationale for the inconsistent syntax?

Thanks!

P.S. My actual use case for this functionality is rendering a heterogeneous collection, in which each entity is aware of its subtemplate and subtemplate-scope. I would like to render the subtemplate, even if the scope is empty, which makes the colon-syntax cleaner than a conditional.