I don't think there's any functional advantage either, it seems more like a semi-arbitrary implementation decision. It's a bit counterintuitive indeed, in the sense that for the same string (that does not correspond to an existing channel), $chan() gives different results, depending on chantypes. That said, I can't imagine why this would inconvenience anybody (especially since there is a proper way to check for a channel, namely ischan).

On a less serious note, this behaviour could be used as a shorter way of checking whether a string is a valid channel name, i.e. instead of doing
if ($left(string,1) isin $chantypes)
you'd do
if ($chan(string) !isnum)
and save a whole 11 characters!

(yes, there are other requirements for a string to be a valid channel name, such as absence of spaces or commas, but you have to check for those anyway)


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com