* Function optionals.

svn path=/nixpkgs/trunk/; revision=10553
This commit is contained in:
Eelco Dolstra 2008-02-08 11:48:06 +00:00
parent 248004a624
commit 48f544d2e3
1 changed files with 4 additions and 0 deletions

View File

@ -180,6 +180,10 @@ rec {
# (e.g. `++ optional (system == "i686-linux") flashplayer').
optional = cond: elem: if cond then [elem] else [];
# Return a list or an empty list, dependening on a boolean value.
optionals = cond: elems: if cond then elems else [];
# Return a list of integers from `first' up to and including `last'.
range = first: last: