jrsonnet
jrsonnet copied to clipboard
std.foldr doesn't work for strings
From https://github.com/google/go-jsonnet/blob/master/testdata/foldr_string.jsonnet:
std.foldr(function(v, i) i + v + v, 'bcd', 'a')
[I] ➜ cjsonnet -e "std.foldr(function(v, i) i + v + v, 'bcd', 'a')"
"addccbb"
[I] ➜ jsonnet -e "std.foldr(function(v, i) i + v + v, 'bcd', 'a')"
"addccbb"
[I] ➜ jrsonnet -e "std.foldr(function(v, i) i + v + v, 'bcd', 'a')"
type error: expected array, got string
argument <arr> evaluation
<cmdline>:1:1-49: function <builtin_foldr> call
@Duologic Thank you , when test your code, I found a bug in sjsonnet;)