TIP #163 Version 1.1: A [dict merge] Subcommand

This is not necessarily the current version of this TIP.


TIP:163
Title:A [dict merge] Subcommand
Version:$Revision: 1.1 $
Author:Joe English <jenglish at users dot sourceforge dot net>
State:Draft
Type:Project
Tcl-Version:8.5
Vote:Pending
Created:Friday, 14 November 2003

Abstract

This TIP proposes a new [dict] subcommand which is used to combine multiple dictionaries.

Specification

	dict merge ''dictVal1'' ''dictVal2'' ''...'' ''dictValN''

Returns a new dictionary containing all the key/value pairs in dictVal1 through dictValN. In the case of duplicate keys, values from later arguments override those from earlier ones.

Implementation

See SF Patch #745851 http://sourceforge.net/support/tracker.php?aid=745851

Examples

See the EXAMPLES section of return(n), which currently reads:

 set options [eval [list dict create -level 1] $args]

This could be replaced with

 set options [dict merge {-level 1} $args]

Notes

This feature was suggested during the discussion of TIP #111, but since the vote was already in progress it was not considered at that time.

Copyright

This document has been placed in the public domain.


Powered by TclThis is not necessarily the current version of this TIP.

TIP AutoGenerator - written by Donal K. Fellows