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/
kalbasit has joined #nix-lang
angerman has quit [Ping timeout: 246 seconds]
angerman has joined #nix-lang
jared-w has quit [Ping timeout: 272 seconds]
jared-w has joined #nix-lang
ddellacosta has quit [Ping timeout: 240 seconds]
MichaelRaskin has joined #nix-lang
__monty__ has joined #nix-lang
siraben has joined #nix-lang
<siraben> hello
<infinisil> o/
<infinisil> I guess what you can do to fake streams is make your own cons like representation
<infinisil> > { value = 1; cons = { value = 1; cons = {}; }; }
<{^_^}> { cons = <CODE>; value = 1; }
<infinisil> And have some functions for interacting with that
<siraben> Ah I see.
<infinisil> > repeat value = { value = value; cons = repeat value; }
<{^_^}> error: syntax error, unexpected '=', expecting ')', at (string):320:14
<infinisil> > repeat = value: { value = value; cons = repeat value; }
<{^_^}> repeat defined
<siraben> > { head = 1; tail = { head = 1; tail = {}; }; }
<{^_^}> { head = 1; tail = <CODE>; }
<__monty__> Or, when in doubt, church-encode ; )
<infinisil> Hehe or that
<siraben> How do I load a nix file in repl?
<siraben> nix repl foo.nix
<siraben> Hm that didn't work
<siraben> Ah I type :l ./foo.nix in the repl
<infinisil> I think that should behave the same as nix repl foo.nix
<siraben> infinisil: This still fails? http://ix.io/2uT4
<infinisil> fails how
<siraben> segfault when I try to get res
<siraben> Also, how do I get rid of needing to type { kons = kons; }
<siraben> I guess I should just return a recursive set
<infinisil> Probably inf rec again, I generally avoid nix repl because it can give worse errors
<siraben> Hm
<siraben> infinisil: How should I evaluate it?
<infinisil> nix-instantiate --eval file.nix
<siraben> Ok
<infinisil> I have `alias ne="nix-instantiate --eval"`
<siraben> What about nix-eval -f foo.nix cons
<infinisil> I think nix eval does the same so yeah probably
<siraben> Still segfault, ugh.
<siraben> If I don't listify res, it works.
<siraben> nix eval -f foo.nix res
<siraben> { head = 3; tail = { head = 3; tail = { head = 3; tail = { head = 3; tail = { head = 3; tail = { head = 3; tail = { head = 3; tail = { head = 3; tail = { head = 3; tail = { head = 3; tail = { }; }; }; }; }; }; }; }; }; }; }
<siraben> infinisil: how did you write the parser for nixlisp?
<infinisil> siraben: It's just nix code, no custom parser :P
<siraben> infinisil: interesting. Does it have proper lexical scoping?
<infinisil> Yup!
<infinisil> It's super hacky but yes
<siraben> Ah, nice!
<siraben> Heh, parser combinators in Nix, anyone?
<infinisil> I think I saw parser combinators recently
MichaelRaskin has quit [Ping timeout: 240 seconds]
MichaelRaskin has joined #nix-lang
<siraben> infinisil: wow
ddellacosta has joined #nix-lang
__monty__ has quit [Quit: leaving]