<pie_[bnc]>
oh oops looks like i forgot to rejoin here
<infinisil>
o/
<pie_[bnc]>
anyway, consider: if nix didnt forget the damn default arguments, you could have half decent overridable let expressions with lib.makeOverridable ({ a ? 1, b ? 2}: whatever)
<pie_[bnc]>
at least thats my hypothesis
<pie_[bnc]>
i forgot about it and coded myself into a corner
<pie_[bnc]>
i've got a lot of https://bpaste.net/J2DA and cant meaningfully override because old arguments are missing
<pie_[bnc]>
hm wel actually i guess that just means i cant do appends
<pie_[bnc]>
hm, well actually i guess that just means i cant do appends. but thats a good chunk of useful overrides gone nevertheless.
<MichaelRaskin>
Wait. you care about simple defaults or about cross-dependent defaults?
<pie_[bnc]>
both?
<pie_[bnc]>
you mean like { a? 1 , b ? 2} vs { a ? 1 , b ? a}
<pie_[bnc]>
?
<MichaelRaskin>
Yes
<pie_[bnc]>
the problem is `f = lib.makeOverridable ({ a ? 1 }: a)` forgets `a` for f.override (old: { a = a.old + 1; })
<pie_[bnc]>
* old.a
<pie_[bnc]>
so it will complain about no attribute a for old
<pie_[bnc]>
> let f = lib.makeOverridable ({ a ? 1 }: a); in f.override (old: { a = old.a + 1; })
<{^_^}>
value is a function while a set was expected, at (string):296:48
<pie_[bnc]>
> let f = lib.makeOverridable ({ a ? 1 }: a); in (f {}).override (old: { a = old.a + 1; })
<{^_^}>
value is an integer while a set was expected, at (string):296:48
<MichaelRaskin>
And basically for such a construction you need both halves — argument set with overrides _and_ argument set without overrides
<MichaelRaskin>
(To allow cross-dependencies of defaults to rerun)
<pie_[bnc]>
i cant figure out how to use my own functions lol
<pie_[bnc]>
hold on
<pie_[bnc]>
MichaelRaskin: im not sure what you mena
<pie_[bnc]>
mean
<pie_[bnc]>
> let f = lib.makeOverridable ({ a ? 1 }: { inherit a; }); in (f {}).override (old: { a = old.a + 1; })