summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--mew.scm1
-rw-r--r--mew.svnwiki7
-rw-r--r--tests/test.mew1
3 files changed, 7 insertions, 2 deletions
diff --git a/mew.scm b/mew.scm
index 7756746..51c3e47 100644
--- a/mew.scm
+++ b/mew.scm
@@ -389,6 +389,7 @@
 
   (define range
     (case-lambda
+      (()               (make-range-generator 0 +inf.0 1))
       ((start)          (make-range-generator start +inf.0 1))
       ((start end)      (make-range-generator start end 1))
       ((start end step) (set! start (- (+ start step) step))
diff --git a/mew.svnwiki b/mew.svnwiki
index 03d91c7..c248917 100644
--- a/mew.svnwiki
+++ b/mew.svnwiki
@@ -349,9 +349,12 @@ Generic generator for list/vector/string/hash-table/generator.
 
 Alias for {{circular-generator}}.
 
-<procedure>(range <start> <end>? <step>?)</procedure>
+<procedure>(range <start>? <end>? <step>?)</procedure>
 
-A variant of {{make-range-generator}} that also allows negative {{step}}.
+A variant of {{make-range-generator}} that also allows negative {{<step>}}.
+{{<start>}} defaults to zero.
+{{<end>}} defaults to infinity.
+{{<step>}} defaults to 1.
 
 <procedure>(giterate <fun> <val>)</procedure>
 
diff --git a/tests/test.mew b/tests/test.mew
index b895780..daeffc1 100644
--- a/tests/test.mew
+++ b/tests/test.mew
@@ -31,6 +31,7 @@
   (test '(1 3 5) (into '() (range 1 7 2)))
   (test '(3 2 1) (into '() (range 3 0 -1)))
   (test '(2 3 4) (into '() (gtake (range 2) 3)))
+  (test '(0 1 2) (into '() (gtake (range) 3)))
   (test '(1 3/2 2 5/2) (into '() (gtake (range 1 +inf.0 1/2) 4)))
   (test '(1 1 1 1) (into '() (gtake (range 1 +inf.0 0) 4))))