Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 4ce9c88c10c3b251fb73e30a35860369053111a4
Ticket: 1880941fffffffffffffffffffffffffffffffff
lassign behavior on excess arguments
User & Date: coldstore on 2008-01-28 03:42:22
Changes

  1. assignee changed to: "dkf"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    [set y 1; lassign a x y; set y] returns "", I think it should return 1.
    
    Commonly [lassign] is used to assign a list of values to variables, as (for example) a way of interpreting multiple return values.
    
    In the case that there's no value, it's useful to be able to assign a default.  The proposed behavior, that unmatched variables be left alone, permits one to implement defaulting behavior, example:
    
      lassign $defaults x y z
      lassign [function] x y z
    
    Where the current behavior requires a fairly tedious series of [if] if one needs to distinguish between defaulted values and "".
    
    
  4. foundin changed to: "None"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "coldstore"
  10. subsystem changed to: "16. Commands A-H"
  11. title changed to: "lassign behavior on excess arguments"
  12. type changed to: "RFE"