Overview
| Artifact ID: | 0e0f411a918c289c084a8a0bb3a3f5ee8524fe5b |
|---|---|
| Ticket: | 883865ffffffffffffffffffffffffffffffffff
Add ?-nocomplain? switch to [dict get] |
| User & Date: | dkf on 2004-01-27 16:35:32 |
Changes
- closedate changed to: "2004-01-27T09:35:32"
- closer changed to: "dkf"
- 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. - login: "dkf"
- mimetype: "text/plain"
- resolution changed to: "Rejected"
- status changed to: "Closed"
- subsystem changed to: "15. Dict Object"
- username: "dkf"