Is YAMLScript a drop in replacement for expressions in Helm charts?
I'm working towards having YS be 100% Go based, rather than JVM based. After that I am going to give another big push on HelmYS
https://rosettacode.org/wiki/Category:YAMLScript#mw-pages now has more Rosetta Code examples (675) than https://rosettacode.org/wiki/Category:Clojure#mw-pages (648)!
Also https://github.com/acmeism/RosettaCodeData (the github repo with all the code on all the languages) is up to date as of today.
Regarding:
(let [x (if (> y z) (bar x) x)])
You can use a cond-> idiom in Clojure:
(let [x (cond-> x (> y z) bar)])
Although I would avoid rebinding x.> it's 15 language bindings and the http://yamlscript.org website That's a lot of languages!
I can get to 42 easily 😉
here's a demo of a gloat genned .so bound to 23 langs
but I've identified over 20 more
@neumann thanks for weighing in here. Wasn't aware of cond-> though I don't think that solves the issue in general.
Only because the example is a fn call, right?
$ ys -ce '
defn f(x):
x :if (a > b) =: 123'
(defn f [x] (let [x (if (> a b) 123 x)]))In that case, you're only repeating x because you're rebinding, and rebinding is generally discouraged in Clojure.
I won't go far as to say it's never done, but I would say making rebinding more convenient is a non-goal for Clojure.