1
0
Fork 0
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:
Eelco Dolstra 2006-09-24 15:21:48 +00:00
parent 2ab4bc44c7
commit df8873e14a
2 changed files with 13 additions and 1 deletions

View file

@ -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: