yogthos/Selmer

String keys in for loops

Open

#133 ouverte le 5 oct. 2016

Voir sur GitHub
 (1 commentaire) (0 réactions) (0 assignés)Clojure (86 forks)batch import
enhancementhelp wanted

Métriques du dépôt

Stars
 (670 stars)
Métriques de merge PR
 (Merge moyen 39m) (4 PRs mergées en 30 j)

Description

Related to #54 I am trying to do something similar with a for loop.

As an example if the for variable is a keyword this works

(render "{% for a in Amt %}{{a.attr.Ccy}}{{a.content.0}} {% endfor %}" 
    {:Amt [{:attr {"Ccy" "USD"}, :content ["0.010000000"]} 
           {:attr {"Ccy" "GBP"}, :content ["0.020000000"]}]})
 => "USD0.010000000 GBP0.020000000 "

However changing :Amt to "Amt" produces nothing

 (render "{% for a in Amt %}{{a.attr.Ccy}}{{a.content.0}} {% endfor %}" 
    {"Amt" [{:attr {"Ccy" "USD"}, :content ["0.010000000"]} 
            {:attr {"Ccy" "GBP"}, :content ["0.020000000"]}]})
=> ""

Should this be added as an enhancement to make processing consistent?

Guide contributeur