mIRC Home    About    Download    Register    News    Help

Print Thread
recursive alias not triggers identifier warning #267557 09/08/20 01:48 AM
Joined: Jan 2004
Posts: 1,410
maroon Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,410
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)
}


Re: recursive alias not triggers identifier warning [Re: maroon] #267558 09/08/20 05:56 AM
Joined: Dec 2002
Posts: 4,830
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,830
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.

Re: recursive alias not triggers identifier warning [Re: Khaled] #267562 10/08/20 04:25 AM
Joined: Jan 2004
Posts: 1,410
maroon Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,410
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.

Re: recursive alias not triggers identifier warning [Re: maroon] #267564 10/08/20 08:39 AM
Joined: Dec 2002
Posts: 4,830
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,830
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.