juxt / aero

A small library for explicit, intentful configuration.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#ref pointing to #ref sometimes works and sometimes it doesn't

zetafish opened this issue · comments

#ref pointing to other #ref sometimes work and sometimes not

Consider this config.edn

;; config.edn
{:x #or [#ref [:none] "default"] 
 :b #ref [:x]
 :c #ref [:x]
 :d #ref [:x]}

Reading this with aero:

(aero/read-config "config.edn")

I expect that this would return a map like

{:b "default" :c "default" :d "default" :x "defaul"}

but instead I get a map

{:b nil, :d nil, :x default, :c default}

and aero emits warnigns:

WARNING: Unable to resolve "#ref [:x]" at [:b]
WARNING: Unable to resolve "#ref [:x]" at [:d]
WARNING: Unable to resolve "#ref [:none]" at [:x :form 0]

Apparently aero resolves the #ref things in an unspecified order and than you can get lucky or not. Is #ref pointing to #ref something that aero should support?