Version 0 of How was I invoked?

Updated 2009-01-19 14:25:20 by Cameron

Consider this example:

  proc show_invocation {} {
      return [info level -1]
  }


  proc a args {
      puts "Beginning of a."
      puts [show_invocation]
  }


  proc b args {
      a x y z
  }

  proc c args {
      b 1 2 3
  }

  c skip-to-my-lou

It has output

  Beginning of a.
  a x y z

In English words, this illustrates that a proc can report on the command-line which invoked it. In particular, this provides a base for introspection on the proc call-stack, coded in "Print proc sequence", "A basic debugger", "List the call stack", and perhaps elsewhere.


There's more, though ...


enter categories here