Artifact 6738820845b7da8a7bd18d9697c7b7a6b43e07d67175c77b51cfac7cdac1157a:
- File
tip/214.tip
— part of check-in
[eee8d00e7d]
at
2009-08-02 14:01:46
on branch trunk
— Withdrawn, as Tcl 8.6 includes this as an unsupported feature.
::tcl::unsupported::representation /value/
There's been a consistent distaste for doing this sort of thing as a supported thing; that would add stronger types by the backdoor as it would let people make code conditional on the type of the arguments, which is counter to the spirit of Tcl. (user: dkf size: 1517)
TIP: 214 Title: Add New Object Introspection Command Version: $Revision: 1.7 $ Author: Ulrich Sch�bel <[email protected]> Author: Larry W. Virden <[email protected]> State: Withdrawn Type: Project Vote: Pending Created: 24-Aug-2004 Post-History: Keywords: Tcl,info,representation Tcl-Version: 8.7 Obsoletes: 117 ~ Abstract This TIP proposes the new '''representation''' subcommand to '''info''' which returns the internal representation of a variable's contents. ~Rationale Inspired by a posting on news:comp.lang.tcl by Victor Wagner, I considered a facility to obtain the internal representation of the value of a variable to be useful. * It further extends the Tcl introspection commands. * It offers a method to check the type of a variable without conversion. * During the development process it is useful to detect/avoid shimmering and its negative performance effects. ~Proposed Change Add the new subcommand '''info representation''' with the following syntax: > '''info representation''' ''varName'' It returns the type of the variable ''varName'' or an error, if * ''varName'' doesn't exist, * ''varName'' is an array and no index is provided, * ''varName'' is a scalar variable but an index is provided. ~Implementation A patch against Tcl8.4.6 is available [http://sf.net/support/tracker.php?aid=1015338]. ~Copyright This document has been placed in the public domain.