Overview
| Artifact ID: | 27cd931735c10e072a2482baf7ca20ed9eb20d7ab82f52b247db896966eed7d7 |
|---|---|
| Ticket: | 0ee626dfb24ee37f6ef1e4955b114ff09ea350f3
lseq numeric overflow |
| User & Date: | apnadkarni on 2025-06-09 11:53:54 |
Changes
- icomment:
@griffin I still have discomfort with the return of an empty list under conditions where we should generate errors. For example, ``` % llength [lseq -0x8000000000000000 to -1 by 1] 0 ``` which is clearly wrong. Since Tcl cannot handle counts that large, it should generate an error, not return a bogus result. Also, with regards to step size of 0, consider ``` % lseq 42 to 42 by 0 % ``` The return value I would expect is {42}, not an empty string. But the documentation states a step size of 0 will return an empty list so **behaves as documented**. Still unexpected in my opinion and should be changed. Conversely, if start != end, a step size of 0 is an infinite series of "start" and not an empty sequence. Given Tcl cannot represent that, again an error should be raised. If we fix the former and not the latter, we have inconsistency like ``` [llength [lseq 42 to 42 by 0]] > [llength [lseq 42 to 43 by 0]] ``` If you disagree with the above and no one else has a problem with the current behavior, I'll leave it as it is. - login: "apnadkarni"
- mimetype: "text/x-markdown"