Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

typeset within functions



Hi all,

I want to be able to dump a variable's value to a file from within a
function.  The typeset built-in would be ideal, because it handles
different types of variables (strings, arrays ...); however it doesn't
work:

% foo=(a b c)
% typeset foo
foo=(a b c)
% foo () { typeset foo }
% foo

I notice compdump does it the hard way, but then compdump knows the
type of each of the variables it is dumping.  Is there any way of
doing this, short of using ${(t)...} ?

Adam



Messages sorted by: Reverse Date, Date, Thread, Author