comp.lang.tcl
[Top] [All Lists]

Re: merging variables and arrays ...

Subject: Re: merging variables and arrays ...
From: Donald Arseneau
Date: Fri, 30 May 2008 14:51:53 -0700 PDT
Newsgroups: comp.lang.tcl



Andreas Leitgeb wrote:
> Donald Arseneau <asnd@xxxxxxxxx> wrote:
> > On May 29, 3:27 am, Andreas Leitgeb <a...@xxxxxxxxxxxxxxxxxxxxxxxx>
> > wrote:
> >> Imagine, that every array had one extra slot which is accessed
> >> only through the basename.
> >> % array set a {1 one 2 two}
> > trace add variable a read foo
>
> I'm not sure what you mean with that.

It was meant to say that traces on the whole array
alreay "use up" that syntax, leaving no way to
specify traces on the scalar version of the variable
(which you also call the "default value").  Sorry
for being too cryptic.

> If it's a question, how that proposal deals
> with traces, then please reread the original
> post, since I spent a few paragraphs on it.

Which say:

} tracing on the base variable will trigger for each,
} element or default access; the appended arguments
} (to the callback) will indicate variable or array-
} element access.
}
} read-traces on the default value will trigger also
} for read-access to undefined keys.

Indicating you still expect to have traces for both
the whole array ("base variable") and separately for
the scalar ("default value"), but both of these would
naturally be declared the same way (the command
I showed).  Yes, you could implement some other
syntax for establising traces on the default value, but
that is another "WTF" trap.

Donald Arseneau                         asnd@xxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>
Privacy Policy