var list/defined_functions = new
#define function(a,b) proc/a() {defined_functions += #a; b}
function(demo,
return(123)\
)
mob/Login()
world << demo()
for(var/i in defined_functions)
world << "Found(<tt>[i]</tt>)"
Created a #define that treats it as if you're defining the name of it as the 1st arg and the code itself as the 2nd argument.
The above code works as expect until you throw in this.
function(demo,
if(1){return(321)}\
return(123)\
)
I receive this error
error: unterminated text doc (expecting "})
pretty sure you need the parenthesis after function(demo). Currently you're trying to define the contents of the function as arguments with this approach, which; intentional or not, seems like a nonsense thing to try to do with DM.
I get you like using DM in unorthodox ways, but i don't see how that would compile properly to begin with.