* Function to return a range of numbers.
svn path=/nixpkgs/trunk/; revision=8850
This commit is contained in:
parent
6d58d51440
commit
9816367ed1
@ -118,4 +118,11 @@ rec {
|
|||||||
optional = cond: elem: if cond then [elem] else [];
|
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;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user