added debug functions tracing function arguments and result

svn path=/nixpkgs/trunk/; revision=13540
This commit is contained in:
Marc Weber 2008-12-02 12:26:05 +00:00
parent 38cf2a4d7e
commit 01fc783e7f

View file

@ -577,6 +577,11 @@ rec {
else if (x == false) then "x is boolean false"
else if (x == null) then "x is null"
else "x is probably a string starting, starting characters: ${__substring 0 50 x}..";
# trace the arguments passed to function and its result
traceCall = n : f : a : let t = n2 : x : traceMarked "${n} ${n2}:" x; in t "result" (f (t "arg 1" a));
traceCall2 = n : f : a : b : let t = n2 : x : traceMarked "${n} ${n2}:" x; in t "result" (f (t "arg 1" a) (t "arg 2" b));
traceCall3 = n : f : a : b : c : let t = n2 : x : traceMarked "${n} ${n2}:" x; in t "result" (f (t "arg 1" a) (t "arg 2" b) (t "arg 3" c));
innerClosePropagation = ready: list: if list == [] then ready else