Re: A tiny bit of code by RS puzzles me
From: Andreas Leitgeb (avl_at_gamma.logic.tuwien.ac.at)
Date: 11/29/04
- Previous message: Wojciech Kocjan: "Re: sqlite and "updatetrigger""
- In reply to: Helmut Giese: "A tiny bit of code by RS puzzles me"
- Next in thread: Donal K. Fellows: "Re: A tiny bit of code by RS puzzles me"
- Reply: Donal K. Fellows: "Re: A tiny bit of code by RS puzzles me"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 29 Nov 2004 13:10:36 GMT
Helmut Giese <hgiese@ratiosoft.com> wrote:
> [...quote from one of RS's wonderful pages...]
> proc integer args {
> foreach arg $args {
> uplevel 1 "trace var $arg w {incr $arg 0 ;#}"
> }
> }
While it is surely a nice hack, it still *is* a hack
with severe limitations:
It will fail (or worse) for certain not-well-behaving
variable names, (ok, this could be said to be user's
responsiblity)
It will also fail, if the variable is lateron upvar'ed
to some procedure to a different name, because the trace-
command will utterly fail in that foreign context.
(Those arguments that are here ignored with this ";#"
trick contain the information that would be needed to
handle the situation properly) ... this is the most
severe limitation of this hack in my eyes.
Finally, while it will correctly throw an error on attempt to
write a non-integral value, it will still leave the variable
with the altered invalid value. (this is a shortcoming of
variabe-traces in general, not of this proc)
PS: So, kids, don't do this at home :-/
- Previous message: Wojciech Kocjan: "Re: sqlite and "updatetrigger""
- In reply to: Helmut Giese: "A tiny bit of code by RS puzzles me"
- Next in thread: Donal K. Fellows: "Re: A tiny bit of code by RS puzzles me"
- Reply: Donal K. Fellows: "Re: A tiny bit of code by RS puzzles me"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|