View · Search · Index
No registered users in community xowiki
in last 10 minutes

[Xotcl] Testing for execution inside object

From: Kristoffer Lawson <setok_at_fishpool.com>
Date: Tue, 3 Oct 2006 13:49:59 +0300

I need to know if the current procedural context is inside a method
(isntproc, proc, whatever) or not. What is the best way to do this? I
used [self] to check by catching the error, but that doesn't work
particularly well if another package happens to define the command
[self]. Besides, I've never been fond of having to resort to error-
catching to find out information (a bit like how people used to test
for the existence of an array element with [catch]).

            / http://www.fishpool.com/~setok/