Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: cb8f2bae1afe64d9929cd30b19f8b51031e521c8
Ticket: 1143805fffffffffffffffffffffffffffffffff
Impurity of empty [list]
User & Date: lars_h on 2005-05-11 17:57:06
Changes

  1. icomment:
    Logged In: YES 
    user_id=938835
    
    How I wish the powers that be would spend more electronic ink on the 
    actual _issue_ than on the _symptoms_ of the issue.
    
    The issue in this report is *not* that real values can be distorted by loss of 
    internal representation; that was merely a (AFAICT standard) method of 
    demonstrating that the issue exists; a way of exhibiting a symptom. I 
    could instead have used the (less standard, and thus more obscure) 
    alternative of losing a wide internal representation of 65536 (as in 
    RFE#866469) to demonstrate the issue, but I chose not to, because I felt 
    that that could cloud the issue. However in view of how this report has 
    been examined, it seems it wouldn't have mattered; the issue got clouded 
    by concerns for symptoms anyway.
    
    The actual _issue_, that neither TIP#132 nor TIP#237 will address, is that 
    an impure return value from [list] can in some cases cause an essentially 
    constant time operation to effectively take linear time, thus (if one is 
    unlucky) increasing the exponent of just about any polynomial time 
    algorithm by one when implemented in Tcl. The response from dgp that 
    Tcl'ers should not be concerned with such matters is hopefully not a well 
    thought through position.
    
    On the bright side, TIP#157 ({expand}) will hopefully lead to a drastic 
    decrease in the number of [eval] constructions that may be harmed by an 
    impure list result, so the issue should become less and less important 
    over time. I still miss an explanation of why Tcl_ListObjCmd should have a 
    special case for no arguments however. Is it just a case of overdoing 
    optimisation, or does anyone have an actual motivation?
    
    And for the record, in case anyone wants a [list] equivalent that always 
    returns a pure list, they can do
       interp alias {} list {} lreplace x 0 0
    
    
  2. login: "lars_h"
  3. mimetype: "text/plain"
  4. username: "lars_h"