Version 0 of TIP #323: Do Nothing Gracefully

Updated 2015-06-13 08:40:45 by pooryorick

TIP #323: Do Nothing Gracefully , by Colin McCormack, Donald Porter, and Kevin Kenny, and implemented in Tcl version Changes in Tcl/Tk 8.6, provides the rationale for commands that do do nothing under certain circumnstances.

Description

With the advent of the {*} operator which expands an empty list into nothing at all, it became clear that it would be useful in various cases if commands that normally accept variable number of arguments at the end of the command could handle the case of no arguments at all being passed. The TIP modified the following commands:

file delete
Accept zero pathnames.
file mkdir
Accept zero directorie.
global
Accept zero variable names.
glob
Accept zero patterns and return a no matches error, or when -nocomplain is provided, return a list of zero mathing files.
lassign
Accept zero variable names [L1 ].
linsert
Accpet zero elements [L2 ].
lrepeat
Accept both a number of 0, and zero elements [L3 ].
my variable
Accept zero variable names.
namespace upvar
Accept zero variable names
::tcl::tm::path add
Accept zero paths.
::tcl::tm::path::remove
Accept zero paths.
variable
Accept zero variable names [L4 ].