Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: f23f179884bef30c584d4aa314634f9695f862cfeeb27472c535e25045125c8e
Ticket: f05f5ef759c1f7f93903fd873250a4c76147c4b2
lseq - duplicative expr eval, bottleneck by usage of operators, inconstistent handling of indices (int vs. double vs. error), etc
User & Date: sebres on 2024-06-12 11:50:46
Changes

  1. icomment:
    <blockquote><i>&gt; As for #3, it was intentional to have the string representation used to determine the number of significant fractional digits.</i></blockquote>
    
    It was clear to me. I only spoke about that it happens inconsistently.
    As I said sometimes (e. g. in expressions) round-able doubles causes integer series.
    For instance [./artifact?name=90d44fdab7ffb386&ln=4058-4061|this one] avoided that it'd return original double and therefore the [./artifact?name=90d44fdab7ffb386&ln=4182|trigger with useDoubles] would not be active.
    
    Let alone another corner cases, e. g. for large (or small) doubles like 1e50 the expression <code>floor(d) == d</code> could be theoretically true, but I doubt it'd work in C (in opposite to Tcl) due to integer overflow.
    
    <blockquote><i>&gt;It's how one can intentionally get: lseq 1.0 3.0 1 -> "1.0 2.0 3.0 4.0" versus lseq 1 3 1 -> "1 2 3 4".</i></blockquote>
    
    Yes, but not always. Here is an example where it was not so:
    <code><pre style="padding-left:2rem;">
    % lseq        1.0            3.0     1
    1.0 2.0 3.0
    % lseq [expr {1.0+0}] [expr {3.0+0}] 1
    1.0 2.0 3.0
    % lseq       {1.0+0}        {3.0+0}  1
    <span style="color:red;">1 2 3</span>
    % lseq       {1.1+0}        {3.1+0}  1
    1.1 2.1 3.1
    &nbsp;
    % lseq [expr {1e50+0}] [expr {1e50+1}]
    1e+50
    % lseq       {1e50+0}        {1e50+1}
    <span style="color:red;">bad operation "1e50+0": must be .., to, count, or by</span>
    </pre></code>
    
    This is exactly what one'd call inconsistency. So I fixed it during my review together with other stuff.
    
  2. login: "sebres"
  3. mimetype: "text/x-fossil-wiki"