Typeinfo package has two commands, typeof and typenames. typeinfo::typeof returns a data type of a value. If the value are assigned to no type, it returns empty. Tcl is a typeless language, I know the concept. But Tcl has a no way to distinguish bytearray data from string data. I took pains to do it, so I wrote this!! typeinfo::typenames returns a list of registerd types.

License

BSD-Style

Download

How to use

% package require Typeinfo
% typeinfo::typenames
boolean index double end-offset wideInt list cmdName bytecode 
nsName procbody bytearray int {array search} string
% typeinfo::typeof abc
% typeinfo::typeof [string toupper abc]
string
% typeinfo::typeof [encoding convertto cp932 abc]
bytearray
% typeinfo::typeof [expr 1]
int
% typeinfo::typeof [expr 1.0]
double
% typeinfo::typeof [expr 10000000000]
wideInt
% typeinfo::typeof [list a b c d]
list
% package require dict
8.5.3
% typeinfo::typeof [dict create]
dict

Comment



CategoryTclTk CategoryEnglish


|New|Edit|Freeze|Diff|Backup|Attach|Copy|Rename|
Last-modified: 2007-02-19 (Mon) 01:23:00 (4291d)
HTML convert time: 0.015 sec.