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.
BSD-Style
% 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