Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 0e0f411a918c289c084a8a0bb3a3f5ee8524fe5b
Ticket: 883865ffffffffffffffffffffffffffffffffff
Add ?-nocomplain? switch to [dict get]
User & Date: dkf on 2004-01-27 16:35:32
Changes

  1. closedate changed to: "2004-01-27T09:35:32"
  2. closer changed to: "dkf"
  3. icomment:
    Logged In: YES 
    user_id=79902
    
    No.  I (and other Core Team members and Core Maintainers)
    hate "-nocomplain" options, and there's already a [dict
    exists] operation to let you create your idea of defaulting
    getter as a composite operation.  For example:
      proc dictgetwithdefault {dict default key args} {
         if {[dict exists $dict $key {expand}$args]} {
            return [dict get $dict $key {expand}$args]
         } else {
            return $default
         }
      }
    
    A separate get-with-default subcommand for [dict] would have
    more sympathy from me, but only if there is performance data
    to justify doing it.
    
    
  4. login: "dkf"
  5. mimetype: "text/plain"
  6. resolution changed to: "Rejected"
  7. status changed to: "Closed"
  8. subsystem changed to: "15. Dict Object"
  9. username: "dkf"