Helpful as this may be, I'm not sure I see the duplication of one extra word as a "major" shortcoming. The difference between a hypothetical $calias and $ctimer/$sockname is that the latter two can be specified to have dynamic names-- aliases cannot, so "hardcoding the name" is really no more hardcoded than it already is. In any case, this seems more like a band-aid on a much greater problem you've alluded to with your example, that problem being the weak state of error handling support in mIRC.

The concept of DRY is more about keeping away from having to repeat code indefinitely. Deciding between writing something exactly once versus exactly twice is not exactly a serious concern to most people. To follow through with your example, the duplication of the term "blabla_blabla" would only become a point of contention if you were to rename the alias name altogether. Of course, most likely if you renamed an alias you would be spending far more time searching through code finding references to the call as compared to the one extra change inside the alias body (the one you're most likely to see). Having this one extra duplication, as annoying as it may seem, is actually not all that error prone. Using your suggested $calias identifier, the example would turn into:

Code:
alias bl_alias1 {
  if ($insufparscheckaliasname($calias,8,$1-)) { return }
  ...
}
alias bl_alias2 {
  if ($insufparscheckaliasname($calias,8,$1-)) { return }
  ...
}
alias bl_alias3 {
  if ($insufparscheckaliasname($calias,8,$1-)) { return }
  ...
}
...

In the end, if we scale the example up, it doesn't really look all that much cleaner from the original example. As you can see, the real eye-sore is that check to begin with, and we still have a lot of repeated code. This is where I start failing to see the benefit of the suggested identifier. You either duplicate a line with a different alias name, or you duplicate the entire line, but really in both cases you're still duplicating the entire line. You could almost say that having to write out the alias name almost justifies the duplication of that error checking line, though I won't take it that far.

If anything, the lack of proper error handling (the likes of try/catch and throw) is the real "major" central issue that makes this a problem to begin with. As I mentioned, you alluded to this issue, which is the real issue in this suggestion. Adding $calias really just covers up the need for something like "/throw error details here" (adding an optional error message param to /halt would be even easier to implement) and having mIRC show this to the user in a consistent fashion (automatically including the alias name on its own).

I should add, by the way, that off the top of my head I can think of no languages that actually have such a "current alias" functionality. Although that's no justification against any feature, the fact that there are highly dynamic languages with no need for the current alias/method name is a relatively good indicator of what the problem really is.


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