This seems more like macros to me, or inline functions. I'm sure people from various paradigms will interject their own ways of doing it...

However, I don't really think there's any real need for mIRC to directly support a new syntax for this kind of idiom. There are already ways, as people pointed out, to get the same effect with virtually the same lines of code.

*NOT* relying on locals, for one thing, would be a good start. mIRC has a limited concept of scope. However, even if it only understands "global" and "local" (and "local-to-script" for aliases), there's no reason to change this.

In your example you use /var's to specify configuration data, but the example does not seem realistic, as I don't see any reason to make that data local. You could easily set the bot name and owner as globals, as even you call them "CONSTANTS". As constants, they should be global. If global to all scripts is a problem, mIRC has /alias -l to create "CONSTANT" identifiers.

alias -l bot.name { return NAME }
alias -l bot.owner { return OWNER }

This is far more in line with what you wanted anyway, because they're actually "constant" in this case, unlike variables. I see no functional difference with this syntax, just aesthetic. However, you do get the aesthetic benefit of *not* having to call "gosub MYROUTINE" at the start of every event, since now you have access to those identifiers without asking. You're actually using less code to express it this way. That, IMO, is a win for the existing syntax over any gosub/macro concept.

I know you admitted your example is weak, but I think that's telling of the fact that there really is no "good example" to illustrate the need of such functionality. Do you have a more realistic example where there really is no 1:1 equivalent using the existing syntax to solve the problem? By 1:1 I mean in rough line of code count. If not, I just don't see any benefit besides yet another way to do the same thing-- and IMO mIRC has enough of those.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"