* Function to return a range of numbers.

svn path=/nixpkgs/trunk/; revision=8850
This commit is contained in:
Eelco Dolstra 2007-06-09 19:45:55 +00:00
parent 6d58d51440
commit 9816367ed1

View File

@ -118,4 +118,11 @@ rec {
optional = cond: elem: if cond then [elem] else [];
# Return a list of integers from `first' up to and including `last'.
range = first: last:
if builtins.lessThan last first
then []
else [first] ++ range (builtins.add first 1) last;
}