AnsweredAssumed Answered

JOBI recursion

Question asked by Michael_Lowry on Dec 4, 2018
Latest reply on Dec 4, 2018 by Michael_Lowry

I was playing around with the idea of building a set of JOBIs to perform basic XML parsing, and quickly realized that recursion would greatly simplify the work. A quick test however revealed that the AE might not support this capability.

 

UCO.RECURSION_TEST.JOBI

:SET &JOBI_Recursion_Depth# = &JOBI_Recursion_Depth#
:IF &JOBI_Recursion_Depth# = ""
: SET &JOBI_Recursion_Depth# = 0
:ENDIF
:SET &JOBI_Recursion_Depth# = &JOBI_Recursion_Depth# + 1
:SET &Max_Recursion_Depth# = 2
:PRINT --- BEGIN UC0.RECURSION_TEST.JOBI Depth: &JOBI_Recursion_Depth# ---
:IF &JOBI_Recursion_Depth# < &Max_Recursion_Depth#
: INCLUDE UC0.RECURSION_TEST.JOBI
:ELSE
: PRINT "Maximum recursion depth (&Max_Recursion_Depth#) reached."
:ENDIF
:PRINT --- END UC0.RECURSION_TEST.JOBI Depth: &JOBI_Recursion_Depth# ---

 

UCO.RECURSION_TEST.SCRI

:INC UC0.RECURSION_TEST.JOBI

 

Result

U00010001 Includes are nested too deep at 'UC0.RECURSION_TEST.SCRI'

 

Is it ever permitted to call a JOBI recursively? How deep is too deep? I’m not trying to implement the Ackermann function here.

Outcomes