[Nix-dev] Re: Attribute selection with default

Ludovic Courtès ludo at gnu.org
Thu Sep 24 13:40:21 CEST 2009


Hi!

Eelco Dolstra <e.dolstra at tudelft.nl>
writes:

> Since this is fairly common, how about some special syntax for supplying a
> default value to the "." selection operator?  I propose the optional "or"
> keyword following an attribute selection "x.<attrpath>".  E.g.
>
>   mainCfg.extraModules or []
>
> or
>
>   config.python.db4Support or true
>
> Comments?

Of course, my first reaction was that “[p]rogramming languages should be
designed not by piling feature on top of feature, but by removing the
weaknesses and restrictions that make additional features appear
necessary.”  ;-)

Other than that, I think it’s a valuable improvement.

Thanks,
Ludo’.




More information about the nix-dev mailing list