Re: A tiny bit of code by RS puzzles me

From: Andreas Leitgeb (avl_at_gamma.logic.tuwien.ac.at)
Date: 11/29/04

  • Next message: Todd M Helfter: "Re: Oratcl and Oracle 10g"
    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 :-/


  • Next message: Todd M Helfter: "Re: Oratcl and Oracle 10g"

    Relevant Pages

    • Re: equiv of LIB$GET_FOREIGN from DCL?
      ... > tell the difference between the user typing ... One HACK to get this is to use the recall buffer. ... I would probably just hardcode my way out. ... Obviously that would fail for those case where a node specific procedure was ...
      (comp.os.vms)
    • Re: Update on Carte Blanche status.
      ... hardware from a file on the SD card directly. ... didn't fail even once yet out of  5 or 6 times tested. ... This is awesome news! ... Hopefully more people will hack it! ...
      (comp.sys.apple2)