[Nix-dev] one small example showing the difference / onother small oddity

Marc Weber marco-oweber at gmx.de
Fri Jul 6 05:49:52 CEST 2007


rec {
 a =2;
 b = 3;
 c = builtins.map ( x : x.y ) a b; # line 4
}

default error message: (you have no clue where to spot this error)
|| error: value is an integer while a list was expected

my alternative message:
|| error: while evaluating the primop function, call defined at `/tmp/test.nix', line 4:
|| value is an integer while a list was expected, value of wrang arg is `2'


And
   c = builtins.map ( x : x ) [] b;
is to be read as
   c = builtins.map ( x : x ) ([] b);
, correct?
because the error message looks like.
|| attempt to call something which is neither a function nor a primop (built-in operation) but a list, at `/tmp/test.nix', line 4

Strange, putting a function there still results in an error:
 c = builtins.map ( x : x ) ( x : x ) []; 

Marc



More information about the nix-dev mailing list