From ae163f596e369abb9679d0efd2b1a782979a6cb1 Mon Sep 17 00:00:00 2001 From: Nicolas Pierron Date: Wed, 27 Aug 2008 13:58:36 +0000 Subject: [PATCH] Replace "finalReference" prefix by "fix". svn path=/nixpkgs/trunk/; revision=12740 --- pkgs/lib/default.nix | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pkgs/lib/default.nix b/pkgs/lib/default.nix index 8b5548bd6d82..c9bb59875d5d 100644 --- a/pkgs/lib/default.nix +++ b/pkgs/lib/default.nix @@ -324,9 +324,11 @@ rec { ) { right = []; wrong = []; }; # Take a function and evaluate it with its own returned value. - finalReference = f: + fix = f: (rec { result = f result; }).result; + finalReference = fix; # bad name + # flatten a list of sets returned by 'f'. # f : function to evaluate each set. # attr : name of the attribute which contains more values. @@ -427,7 +429,7 @@ rec { # Evaluate a list of option sets that would be merged with the # function "merge" which expects two arguments. The attribute named # "require" is used to imports option declarations and bindings. - finalOptionSetsFun = merge: pkgs: opts: + fixOptionSetsFun = merge: pkgs: opts: let optionSet = final: configFun: if __isFunction configFun then configFun pkgs final else configFun; # backward compatibility. @@ -437,8 +439,11 @@ rec { (uniqFlattenAttr (optionSet final) "require" [] (toList opts)) ); - finalReferenceOptionSets = merge: pkgs: opts: - finalReference (finalOptionSetsFun merge pkgs opts); + fixOptionSets = merge: pkgs: opts: + fix (fixOptionSetsFun merge pkgs opts); + + finalOptionSetsFun = fixOptionSetsFun; + finalReferenceOptionSets = fixOptionSets; optionAttrSetToDocList = (l: attrs: (if (getAttr ["_type"] "" attrs) == "option" then