TIP #417: USE EXPLICIT OPTION NAMES FOR "FILE TEMPFILE" ========================================================= Version: $Revision: 1.1 $ Author: Christophe Curis State: Draft Type: Project Tcl-Version: 8.7 Vote: Pending Created: Friday, 16 November 2012 URL: https://tip.tcl-lang.org417.html Post-History: ------------------------------------------------------------------------- ABSTRACT ========== This TIP proposes altering the way in which optional arguments are specified to *file tempfile* (see [TIP #210]) to make them easier to understand and extend in the future. RATIONALE =========== The current documentation for *file tempfile* states that there are two optional arguments using a fixed order. This has some limits: * it is not possible to use the second argument without the first * being an infrequently-used function, having a fixed order implies that a look to the manual page will be obligatory to make sure of the order * this inhibits potential for any future expansion of the command. Switching to option/value format will make the optional arguments easier to understand. PROPOSAL ========== The syntax of the command would be changed to: *file tempfile* ?/options.../? with supported /options/: * *-namevar* /variable/: Specifies a variable for receiving the file name. * *-template* /template/: Defines a template for the file name. This syntax would allow: * easy extension in the future, as any option name can be added, * ability to use any of the options in any order, * an explicit syntax making the code easier to read and understand. REFERENCE IMPLEMENTATION ========================== No implementation is available now, but the change is probably not complex; the priority have been placed on raising the subject before the release of the final 8.6 version of Tcl. COPYRIGHT =========== This document has been placed in the public domain. ------------------------------------------------------------------------- TIP AutoGenerator - written by Donal K. Fellows