mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2004
Posts: 2,127
maroon Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
Is it a "by design" or a "bug" that an alias calling itself as an identifier doesn't trigger the identifier warning? I found this closed thread related to the topic, but it dealt with calling its own name as a /command but didn't say the expected result when called as an $identifier.

https://forums.mirc.com/ubbthreads.php/topics/246559/error-recursive-call

Code
alias test_recursive {
  if ($1 == recursive) return $calc($2 + 1)
  var %x 0
  noop $findfile($mircdir,*.ini,0,var -s %x $test_recursive(recursive,%x) )
  echo -a called %x times recursively from within findfile, but this fails without triggering identifier warning:
  var -s %x $test_recursive(recursive,%x)
}


Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
Thanks for your bug report. Yes, that is how it should behave. Recursion is only blocked if it is a direct call. It is never blocked if it is through an indirect call.

Joined: Jan 2004
Posts: 2,127
maroon Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
Just to be clear, my report was not whether or not the identifier call should be blocked, it was that it was returning $null in spite of "identifier warning" being enabled.

Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
Ah, right, sorry about that. The identifier warning is for non-existent identifiers. In this case, the identifier exists. As has always been the case, a recursive call to the same identifier will return $null.


Link Copied to Clipboard