NixOS/nix — pull request #132 by shlevy (2013-06-10 03:30:46+00:00)
Title: Dynamic attrs

This series adds a new syntax for attribute names:

* `attrs.${name}` is equivalent to `builtins.getAttr name attrs`
* `attrs ? ${name}` is equivalent `builtins.hasAttr name attrs`
* `attrs.${name} or def` is equivalent to `if builtins.isAttrs attrs && builtins.hasAttr name attrs then builtins.getAttr name attrs else def`
* `{ ${name1} = value1; ${name2} = value2; }` is equivalent to `builtins.listToAttrs [ { name = name1; value = value1; } { name = name2; value = value2; } ]`

This eliminates the need for the bulky `getAttr`, `hasAttr`, and `listToAttrs` builtins with a much more nixy syntax.

Sorry for the massive number of commits, I was testing out a new development style (which actually worked fairly well)