diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-09-27 15:43:08 -0400 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-09-27 15:49:20 -0400 |
commit | 95c74eae269b2b9e4bc514581b5caa1d80b54acc (patch) | |
tree | f8f36185fa71202a79ed320e2a413433f957ff63 /tests | |
parent | f46612be96a70a188cd48462ac94089d3e95a36b (diff) | |
download | guix-95c74eae269b2b9e4bc514581b5caa1d80b54acc.tar.gz |
Allow dashes in identifiers
In Nixpkgs, the attribute in all-packages.nix corresponding to a package is usually equal to the package name. However, this doesn't work if the package contains a dash, which is fairly common. The convention is to replace the dash with an underscore (e.g. "dbus-lib" becomes "dbus_glib"), but that's annoying. So now dashes are valid in variable / attribute names, allowing you to write: dbus-glib = callPackage ../development/libraries/dbus-glib { }; and buildInputs = [ dbus-glib ]; Since we don't have a negation or subtraction operation in Nix, this is unambiguous.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lang/eval-okay-attrs5.nix | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/lang/eval-okay-attrs5.nix b/tests/lang/eval-okay-attrs5.nix index e77ee7a1c2..0a98b8fdff 100644 --- a/tests/lang/eval-okay-attrs5.nix +++ b/tests/lang/eval-okay-attrs5.nix @@ -4,7 +4,7 @@ let as = { x.y.z = 123; a.b.c = 456; }; - bs = { foo.bar = "foo"; }; + bs = { f-o-o.bar = "foo"; }; or = x: y: x || y; @@ -13,7 +13,7 @@ in as.foo or "foo" as.x.y.bla or as.a.b.c as.a.b.c or as.x.y.z - as.x.y.bla or bs.foo.bar or "xyzzy" + as.x.y.bla or bs.f-o-o.bar or "xyzzy" as.x.y.bla or bs.bar.foo or "xyzzy" 123.bla or null.foo or "xyzzy" # Backwards compatibility test. |