Skip to content
This repository has been archived by the owner on Apr 30, 2021. It is now read-only.

Iterating over hash keys #9

Open
nowox opened this issue Jun 12, 2015 · 0 comments
Open

Iterating over hash keys #9

nowox opened this issue Jun 12, 2015 · 0 comments

Comments

@nowox
Copy link
Contributor

nowox commented Jun 12, 2015

Let's consider the hash my %hash = ( foo => { a => 42, b => 43, c => 44 } );

It would be interesting to implement something that allows to iterate over hash keys

{{#hash.keys}}
    {{.}}
{{/hash}}

In case of more complex data we can still imaging using the same kind of syntax:

{{#hash.keys}}
    {{.}} {{name}} {{genre}}
{{/hash.keys}}

Or even a full nested hash support:

{{#animals.keys}}
    {{.}}:
    {{#mammal.keys}} 
        {{.}} -> {{name}}
    {{/mammal.keys
{{/hash.keys}}

What do you think?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant