ID:166959
 
Is there some way to do this? Like this:

proc/MyProc()
world << "Running [thisproc()]"


Returns: "MyProc"
proc/MyProc()
var/p_name="MyProc"
world << "Running [p_name]"


Seems like the simplest solution. Isn't there a name variable for procs? Or something like that, that gets set by default?
I don't think so. I've suggested it before, and I've also suggested a way to get not only the current proc but the entire call stack. For now we have to find ways to work around it ourselves.
In response to Scoobert
Well, the proc does have a name; it has to if it can be used as a verb. However, objects don't have a procs list variable like they do for verbs. I suppose perhaps you could add the proc to a verbs list then turn around and treat it as a verb to get its name. But then that takes more work to accomplish the same thing as just having a variable like you showed, so it'd be silly to do.

There should be a keyword for functions that refers to the instance of the function. And then perhaps there should also be an actual object of type /function.
Not unless you build a system that facilitates such a thing, which would be on top of the built-in system. BYOND does not treat procs as objects, as other enviornments like Java sometimes do.