yogthos/Selmer

String keys in for loops

Offen

#133 geöffnet am 05.10.2016

 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)Clojure (121 Forks)batch import
enhancementhelp wanted

Repository-Metriken

Stars
 (1.042 Sterne)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

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?

Contributor Guide