infinisil changed the topic of #nix-lang to: Channel for discussing Nix as a language - https://nixos.org/nix/manual/#chap-writing-nix-expressions - Logs: https://logs.nix.samueldr.com/nix-lang/
ddellacosta has joined #nix-lang
ddellacosta has quit [Ping timeout: 258 seconds]
jtojnar has quit [Quit: jtojnar]
__monty__ has joined #nix-lang
noonien has joined #nix-lang
Synthetica has joined #nix-lang
__monty__ has quit [Quit: leaving]
<pie_> what if we had more power in function arguments so we could do {a.b}: ...
<pie_> i guess that wouldnt really make sense unless the naming of the things that come into scope changed somehow
<pie_> because with the current stuff only the top level attribute matters and you can just access the inner one;
<pie_> > ({a}: a.b) {a.b=1;}
<{^_^}> 1
<pie_> basically im wondering about if it could be possible to limit what you get from callpackage in a nonugly way for stuff like lib
<infinisil> pie_: You mean like proper pattern matching?
<pie_> infinisil, maybe.
<infinisil> Something like `{ a@{ b, ... }, ... }: { inherit a b; }`
<pie_> i mean the mechanism would probably be like that yeah
<pie_> hm
<infinisil> Would fit very well into nix and I've wanted this before
<pie_> but the point is the mechanism doesnt matter unless it has any usable meaning (thats different than the current semantics)
<pie_> but i guess you get what im going for
<pie_> these would work for the specific use case, but of course theyre ugly:
<pie_> {lib}: (foo: ...) lib.foo
<pie_> or
<pie_> {lib}: anApplyF lib.foo (foo: ...)
<pie_> the latter at least getting the "imports" at the top :P
<pie_> i mean with the current semantics
<pie_> but some kind of renaming sounds seems kind of bad for no specific reason
<pie_> {b = a.b }: b
<pie_> i bet that would let you do some weird/neat/horrible stuff
<pie_> feeling a bit syntactic sugary...has anyone thought of giving nix a core language
<pie_> but then i guess one gets into compiler enginenering shenanigans and we dont want to do that yet? :P
<infinisil> Not really getting what you're going for
<pie_> sorry im getting too stream of thought again
<pie_> i gotta stop doing that
pie___ has joined #nix-lang
pie_ has quit [Read error: Connection reset by peer]
__monty__ has joined #nix-lang
<pie___> > a = { "asdf++" = 1}; with a; [ "asdf++" ]
<{^_^}> error: syntax error, unexpected '}', expecting ';', at (string):26:20
<pie___> > a = { "asdf++" = 1;}; with a; [ "asdf++" ]
<{^_^}> error: syntax error, unexpected WITH, at (string):26:24
<pie___> > let a = { "asdf++" = 1;}; in with a; [ "asdf++" ]
<{^_^}> [ "asdf++" ]
<pie___> > let a = { "asdf++" = 1;}; [ a."asdf++" ]
<{^_^}> error: syntax error, unexpected '[', at (string):252:27
<pie___> > let a = { "asdf++" = 1;}; in [ a."asdf++" ]
<{^_^}> [ <CODE> ]
<pie___> i mean
<infinisil> Hehe yeah that's a problem with `with`
<pie___> if you have an attribute name you gotta quote, it wont work with with because you cant access it
__monty__ has quit [Quit: leaving]
pie___ has quit [Ping timeout: 258 seconds]
pie_ has joined #nix-lang
ddellacosta has joined #nix-lang