mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-02 07:31:26 +00:00
* Function to return a range of numbers.
svn path=/nixpkgs/trunk/; revision=8850
This commit is contained in:
parent
6d58d51440
commit
9816367ed1
@ -117,5 +117,12 @@ rec {
|
||||
# (e.g. `++ optional (system == "i686-linux") flashplayer').
|
||||
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…
Reference in New Issue
Block a user