The default of [end] is +inf.0, so it creates an infinite list.
The default for [end] is +inf.0, specifying an infinite list.
If any of start or step is inexact,
from the Gauche manual (a kind of Lisp)
lrange start :optional end step
Creates a lazy sequence of numbers starting from start,
increasing by step (default 1), to the maximum value that
doesn’t exceed end. The default of end is +inf.0, so it
creates an infinite list.
(Don’t type just (lrange 0) in REPL, or it won’t terminate!)
If any of start or step is inexact, the resulting sequence has
inexact numbers.
(Don’t type just (lrange 0) in REPL, or it won’t terminate!)
<-- This sounds (more than) slightly odd. Do you agree?
_______________
The default of [end] is +inf.0, so it creates an infinite list.
better as:
The default for [end] is +inf.0, specifying an infinite list.
_______________
If any of start or step is inexact,
better as: ............
(Don’t type just (lrange 0) in REPL, or it won’t terminate!)
(Don’t type just (lrange 0) in REPL, or it won’t terminate!)
<-- This sounds slightly odd. Do you agree?
There would be 2 kinds of Non-termination.
1. If you enter (lrange 0) into REPL, it will hang.
2. Entering (lrange 0) in REPL would print an infinite list.
i can't guess which is the case for Gauche.
HenHanna wrote:
> (Don’t type just (lrange 0) in REPL, or it won’t terminate!)
>
<-- This sounds slightly odd. Do you agree?
There would be 2 kinds of Non-termination.
1. If you enter (lrange 0) into REPL, it will hang.
2. Entering (lrange 0) in REPL would print an infinite list.
i can't guess which is the case for Gauche.
Oh, i just thought you meant that it was weird that it would allow unterminating constructs in the REPL in the first place. Seeing as how
the previous bits of the documentation already state that the evaluated result of (lrange 0) is an infinite list, i would assume that the ‘it’ in “it won't terminate” refers to the REPL (or rather that command in the REPL).
(Don’t type just (lrange 0) in REPL, or it won’t terminate!)
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 388 |
Nodes: | 16 (2 / 14) |
Uptime: | 10:26:09 |
Calls: | 8,221 |
Files: | 13,122 |
Messages: | 5,872,709 |