Dave Cunningham
Dave Cunningham
I noticed while reviewing #662 that json.hpp which we already depend on now has an implementation of a suitable algorithm for doing this.
https://github.com/google/jsonnet/blob/master/third_party/json/json.hpp#L11957
This seems to do the right thing in Go: ``` fmt.Println(strconv.FormatFloat(0.9, 'g', -1, 64)) ``` The precision behavior is quite easy to specify -- It should produce the shortest string...
It never changes the actual value. The problem is that 0.9 and 0.90000000000000002 are actually the same number in double precision floating point. Also 9E-1. So the point is to...
We can probably just pick something and all implementations can use the same threshold.
That's not a problem, it returns a string that is compatible with a JSON number.
Yeah this has come up a few times. I agree it would be nice. You need a way to be able to compute the fields too, perhaps like this: ```...
Perhaps it is OK to force the user to collect the c and b modification into a single mixin there?
I think you mean: ``` { a.b.c: 1, } ``` is equal to ``` { a+: { b+: { c: 1 } } } ``` whereas ``` { a.b.c+: 1,...
Variables are supposed to be statically bound, so the "import * from" would defeat that. Code like ``` local x = 1; import * from "foo.libsonnet"; x ``` might break...