For Programmers: Free Programming Magazines  


Home > Archive > Tcl > August 2004 > TIP #214: Add New Object Introspection Command









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author TIP #214: Add New Object Introspection Command

2004-08-31, 8:59 pm


TIP #214: ADD NEW OBJECT INTROSPECTION COMMAND
========================================
========
Version: $Revision: 1.1 $
Author: <usus_at_aladyn.de>
State: Draft
Type: Project
Tcl-Version: 8.5
Vote: Pending
Created: Tuesday, 24 August 2004
URL: http://purl.org/tcl/tip/214.html
WebEdit: http://purl.org/tcl/tip/edit/214
Post-History:

-------------------------------------------------------------------------

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 <URL:news:comp.lang.tcl> by Victor Wagner, I
considered a facility to obtain the internal representation of a the
value in variable to be useful.

* It further completes 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
[<URL:http://sf.net/tracker/?func=detail&...&group_id=10894>].

COPYRIGHT
===========

This document has been placed in the public domain.

-------------------------------------------------------------------------

TIP AutoGenerator - written by Donal K. Fellows

[[Send Tcl/Tk announcements to tcl-announce@mitchell.org
Announcements archived at http://groups.yahoo.com/group/tcl_announce/
Send administrivia to tcl-announce-request@mitchell.org
Tcl/Tk at http://tcl.tk/ ]]

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com