Theraze
Active member
I was pondering about whether or not something similar to the following C code was possible with ASH:
Basically, this would be so that in the cases of scripts using nearly idential functions, they can use the function defined in the other. It would likely get called mostly in terms of sanity checks... since abs() was the function that made me ponder this, the sample code following to see if abs needs to be redefined would work:
If this can't happen, so it goes. Just thought that something like this may be useful for those who write scripts that have to play nice with others. 
Code:
#if !defined(sample_function)
sample_function();
#endif
Code:
if (!defined(abs))
abs(int a){
if(a<0) return -a;
return a;
}
else if (abs(-5) != 5){
print("Conflict with another script using the abs function. Stopping script.");
exit;
}
