mirror of
https://github.com/NixOS/nix
synced 2025-07-07 14:21:48 +02:00
* lessThan primitive for integer comparison.
This commit is contained in:
parent
2ab4bc44c7
commit
df8873e14a
2 changed files with 13 additions and 1 deletions
|
@ -2,7 +2,10 @@ with import ./lib.nix;
|
|||
|
||||
let {
|
||||
|
||||
range = first: last: [first] ++ (if first == last then [] else range (builtins.add first 1) last);
|
||||
range = first: last:
|
||||
if builtins.lessThan last first
|
||||
then []
|
||||
else [first] ++ range (builtins.add first 1) last;
|
||||
|
||||
/* Supposedly tail recursive version:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue