Then what you're suggesting clearly cannot work.

$calias inside pcc would return pcc, not the callee. If you wanted it to return only the callee, then you could not do error checking inside the alias itself, for instance:

Code:
alias bl_alias1 { 
  if ($1- == $null) { echo -a * $calias $+ : insufficient parameters. | return }
  ...
}


Instead you would require all error checking to be done in an alias directly called by the alias in question, which ends up being more limiting than it is helpful.

I assume in response to this situation you would suggest that we should have two separate identifiers, $calias and $callee for the two situations... but then what about a scripter who might write the above as:

Code:
alias bl_alias1 { pcc 3 | ... }
alias pcc { 
  if ($0 < $1) error_insufficient_params 
  if ($1 == ...) error_invalid_params
}
alias error_insufficient_params {
  echo $color(info) -a * $callee $+ : insufficient parameters
}
alias error_invalid_params {
  echo $color(info) -a * $callee $+ : invalid parameters
}


Clearly you end up with a case where arbitrary levels of "callee" indirection are needed depending on the level of organization a scripter would use. What you're suggesting is helpful to your specific script organization, not that of other scripters. Of course, again, this is solved by using proper stack traces as per standard try/catch exception handling, which is really what you're alluding to here.

As far as the "less code" argument goes, you're not writing "less" code:

Code:
alias c1 {
  if ($somecheck(c1,3)) return
}


is technically "less code" than the equivalent with $calias.

As I mentioned in the first reply, maintainability is really insignificant in this situation. When you change the alias name you'll be doing more work fixing the calls to the alias than fixing the one extra reference inside the alias body. You also generally don't rename aliases often to begin with.

Given that the only benefit from knowing the alias name is for the one situation where a scripter performs error reporting, it seems to me that this is really more about the error reporting than the alias name itself.


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