/datum/proc/p1()
return
/datum/proc/p2()
return
/datum/proc/p3()
return
/datum/proc/p4()
return
/datum/proc/p5()
return
/proc/main() // Treat this as world/new()
var/list/L = typesof(/datum/proc)
world.log << json_encode(L)
Which will output:
["/datum/proc/p1","/datum/proc/p2","/datum/proc/p3","/datum/ proc/p4","/datum/proc/p5"]
What I think would be cool is the ability to put custom annotations above procs. Say for example
@CustomEventHandler
/datum/proc/mything()
return
/proc/main()
var/datum/D = new()
// Iterate the list of procs. This is just a lazy one for typing sake.
if(D.procs.mything.HasAnnotation("CustomEventHandler"))
D.mything() // Call it since it has the annotation
This would allow developers to easily "mark" procs as ones that can be executed at specific events. Maybe I have been spoiled by Java things, but decorators/annotations would be great, even if it required "typing" of procs or something similar.
Consider the alternative: