00:41
<
gchristensen >
inherit ({builtins = null; }) builtins;
00:41
<
gchristensen >
>> inherit ({builtins = null; }) builtins;
00:41
<
{^_^} >
error: NixParseFailure "error: syntax error, unexpected INHERIT, at (string):1:12\n"
00:41
<
gchristensen >
>> inherit ({builtins = null; }) builtins
00:41
<
{^_^} >
error: NixParseFailure "error: syntax error, unexpected INHERIT, at (string):1:12\n"
00:47
<
infinisil >
>> inherit (pkgs) hello
00:47
<
{^_^} >
error: NixParseFailure "error: syntax error, unexpected INHERIT, at (string):1:12\n"
00:47
<
infinisil >
Hum, I thought inherit's should work too
00:48
<
infinisil >
>> inherit x
00:48
<
{^_^} >
error: NixParseFailure "error: syntax error, unexpected INHERIT, at (string):1:12\n"
01:04
<
infinisil >
> inherit x
01:04
<
{^_^} >
error: syntax error, unexpected INHERIT, at (string):193:1
01:04
<
infinisil >
>> inherit x
01:04
<
{^_^} >
error: NixParseFailure "error: syntax error, unexpected INHERIT, at (string):1:12\n"
01:04
<
infinisil >
>> inherit (pkgs) x
01:04
<
{^_^} >
error: NixParseFailure "error: syntax error, unexpected INHERIT, at (string):1:12\n"
01:06
<
infinisil >
>> inherit (pkgs) x
01:06
<
{^_^} >
error: attribute 'x' missing, at (string):15:42
01:07
<
infinisil >
>> inherit x
01:07
<
{^_^} >
Inherits need a scope
01:07
<
infinisil >
There we go
01:07
<
gchristensen >
>> inherit ({builtins = null; }) builtins
01:07
<
gchristensen >
>> builtins.map
01:07
<
gchristensen >
nice
01:08
<
infinisil >
>> ${"x"} = 10
01:08
<
{^_^} >
Assignments to dynamic keys are disallowed
01:08
<
infinisil >
>> x.${"x"} = 10
01:08
<
{^_^} >
error: attribute 'x' missing, at (string):14:42
01:09
<
infinisil >
>> x = {}
01:09
<
infinisil >
>> x.${"x"} = 10
01:09
<
{^_^} >
{ x = 10; }
01:09
<
gchristensen >
> ${null} = builtins.map
01:09
<
{^_^} >
error: syntax error, unexpected DOLLAR_CURLY, at (string):193:1
01:09
<
infinisil >
>> ${null} = builtins.map
01:09
<
{^_^} >
Assignments to dynamic keys are disallowed
01:10
<
infinisil >
Also, if you want to allow overriding variables, you can do this:
01:11
<
infinisil >
>> x = self.changeablevalue + 1
01:11
<
infinisil >
>> changeablevalue = 10
01:11
<
infinisil >
Whereas:
01:11
<
infinisil >
>> x = changeablevalue + 1
01:11
<
infinisil >
>> changeablevalue = 20
01:13
<
infinisil >
>> x = 2
01:13
<
gchristensen >
>> self.builtins = []
01:13
<
gchristensen >
>> builtins.map
01:13
<
gchristensen >
>>self.${null} = "hi"
01:13
<
gchristensen >
>> self.${null} = "hi"
01:13
<
gchristensen >
>> self
01:13
<
{^_^} >
{
__unfix__ = <LAMBDA>; attrs = <CODE>; builtins = <CODE>; changeablevalue = 20; deepEval = <CODE>; s = <CODE>; self = {
__unfix__ = <LAMBDA>; attrs = <CODE>; builtins = <CODE>; changeablevalue = 20; deepEval = <CODE>; s = <CODE>; self = <CYCLE>; x = 2; y = 20; z = 30; }; x = 2; y = 20; z = 30; }
01:14
<
infinisil >
Ah yes, good point, you can view the environment with self :O
01:15
<
infinisil >
>> self = 1
01:15
<
infinisil >
>> self.self
01:15
<
{^_^} >
error: value is an integer while a set was expected, at (string):18:1
01:15
<
infinisil >
>> self
01:15
<
infinisil >
>> 10 + self
01:20
<
gchristensen >
>> { type = "derivation"; toString = "lolhi"; }
01:20
<
{^_^} >
{ toString = "lolhi"; type = "derivation"; }
01:20
<
gchristensen >
>> toString { type = "derivation"; toString = "lolhi"; }
01:20
* gchristensen
taps the mic
01:20
<
infinisil >
(currently not running, hold on a minute)
01:21
<
infinisil >
>> self
01:22
<
infinisil >
gchristensen: go for it
01:30
<
infinisil >
>> self
01:30
<
{^_^} >
{
__unfix__ = <LAMBDA>; attrs = <CODE>; builtins = <CODE>; changeablevalue = 20; deepEval = <CODE>; extend = <CODE>; s = <CODE>; self = 1; x = 2; y = 20; z = 30; }
01:30
<
infinisil >
>> self.self
01:34
<
gchristensen >
>> toString { type = "derivation"; toString = "lolhi"; }
01:34
<
{^_^} >
error: cannot coerce a set to a string, at (string):19:1
01:36
<
infinisil >
>> assert false; 1
01:36
<
{^_^} >
error: assertion failed at (string):19:1
01:36
<
infinisil >
>> builtins.trace "hello" "hello"
01:36
<
infinisil >
>> builtins.trace "hello" "he"
01:39
<
gchristensen >
>> { outPath = "foo-bar"; }
01:39
<
{^_^} >
{ outPath = "foo-bar"; }
01:39
<
gchristensen >
>> { type = "derivation"; outPath = "foo-bar"; }
01:39
<
{^_^} >
{ outPath = "foo-bar"; type = "derivation"; }
01:39
<
gchristensen >
>> >> toString { type = "derivation"; outPath = "foo-bar"; }
01:39
<
{^_^} >
error: NixParseFailure "error: syntax error, unexpected '>', at (string):1:12\n"
01:39
<
gchristensen >
>> toString { type = "derivation"; outPath = "foo-bar"; }
01:39
<
gchristensen >
>> toString { outPath = "foo-bar"; }
01:41
<
infinisil >
Heh neat
01:41
<
infinisil >
>> "${{outPath = "hi"}}"
01:41
<
{^_^} >
error: NixParseFailure "error: syntax error, unexpected '}', expecting ';', at (string):1:30\n"
01:41
<
infinisil >
>> "${{outPath = "hi";}}"
01:41
<
infinisil >
>> "${let {body.outPath = "hi";}}"
01:42
<
infinisil >
>> inherit (pkgs) hello
01:42
<
infinisil >
>> hello.name
01:42
<
{^_^} >
"hello-2.10"
01:42
<
infinisil >
> hello.name
01:42
<
{^_^} >
"hello-2.10"
01:42
<
infinisil >
> hello.name
01:42
<
{^_^} >
"hello-2.10"
01:42
<
infinisil >
>> hello.name
01:42
<
{^_^} >
"hello-2.10"
01:43
<
infinisil >
> :v weird1
01:43
<
{^_^} >
weird1 = (1.0 * 1) * 1
01:44
<
infinisil >
>> let rec { body = 10; }
01:44
<
{^_^} >
error: NixParseFailure "error: syntax error, unexpected REC, at (string):1:16\n"
01:45
<
infinisil >
>> let (rec { body = 10; })
01:45
<
{^_^} >
error: NixParseFailure "error: syntax error, unexpected '(', at (string):1:16\n"
01:46
<
infinisil >
>> quotes.infinisil = [ "hello" ]
01:46
<
infinisil >
>> quotes.infinisil = quotes.infinisil ++ [ "what" ]
01:46
<
infinisil >
>> deepEval quotes
01:46
<
{^_^} >
{ infinisil = [ "hello" "what" ]; }
01:52
<
infinisil >
Something really cool about this new nix eval is that it can kill old definitions if they're not needed anymore, but keeps them alive otherwise
01:53
<
infinisil >
So if I do
01:53
<
infinisil >
>> x = 1
01:53
<
infinisil >
>> y = x + 2
01:53
<
infinisil >
>> x = 0
01:53
<
infinisil >
And it keeps the x = 1, but if I do
01:53
<
infinisil >
>> y = 0
01:54
<
infinisil >
It can remove the definition for x = 1 out of its state
01:55
<
infinisil >
Can also use this later to implement the ability to remove assignments, because it knows the dependencies between them
01:57
<
infinisil >
>> self
01:57
<
{^_^} >
{
__unfix__ = <LAMBDA>; attrs = <CODE>; builtins = <CODE>; changeablevalue = 20; deepEval = <CODE>; extend = <CODE>; hello = <CODE>; quotes = <CODE>; s = <CODE>; self = 1; x = 0; y = 0; z = 30; }
01:58
<
infinisil >
>> self.__unfix__
01:58
<
infinisil >
>> self.__unfix__ 10
01:58
<
{^_^} >
{ attrs = <CODE>; builtins = <CODE>; changeablevalue = 20; deepEval = <CODE>; hello = <CODE>; quotes = <CODE>; s = <CODE>; self = 1; x = 0; y = 0; z = 30; }
01:59
<
infinisil >
>> ${"x"} + ${"y"}
01:59
<
{^_^} >
error: NixParseFailure "error: syntax error, unexpected DOLLAR_CURLY, at (string):1:12\n"
02:00
<
infinisil >
>> self.${"x"} + self.${"y"}
02:00
<
infinisil >
>> allUp = lib.mapAttrs (n: v: v + 1) self
02:00
<
infinisil >
>> allUp.z
02:01
<
infinisil >
>> z = 1
02:01
<
infinisil >
>> allUp.z