Subscribe Bookmark RSS Feed

Symbol evaluation is too recursive

laisteve17

Occasional Contributor

Joined:

Jun 15, 2017

Hi There,

I am new to JSL and am looking for any documentation (or direct help) figuring out why I got this error:

Symbol evaluation is too recursive (25 levels). in access or evaluation of 'gchFailed' , gchFailed/*###*/

Here is my guess at what information might be useful. Please help me. Thanks in advance!

I have two scripts, a main and a header file. My main file include()'s the header file, which is a bunch of function definitions. Both scripts use Names Default To Here( 1 ) which may be the problem. I have many functions that use the same variable name "gchFailed" as a local variable. The error is produced when I call the following functions:

//within header file, function definition
processGCHFile = function({}, {Default Local},
gchFailed = 0;
if(/* failCase */, gchFailed = 1);
{gchFailed, otherReturnValue}; //return values
);

//within main = function({}, {Default Local}, /*main code*/)
gchRet = processGCHFile(gchFile, saveMap); //return values
gchFailed = gchRet[1]; //this works fine
gchDT = gchRet[2];

if(gchFailed, //this throws the error
print("Failed");
);

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Craige_Hales

Staff

Joined:

Mar 21, 2013

Solution

I think the returned value should look like this:

evalList( {gchFailed, otherReturnValue} ); //return values

so the list contains values of the variables rather than names of the variables.

Craige
4 REPLIES
Craige_Hales

Staff

Joined:

Mar 21, 2013

Solution

I think the returned value should look like this:

evalList( {gchFailed, otherReturnValue} ); //return values

so the list contains values of the variables rather than names of the variables.

Craige
laisteve17

Occasional Contributor

Joined:

Jun 15, 2017

Thank you, Craige! Worked like a charm. I guess JMP expressions are still tripping me up.

txnelson

Super User

Joined:

Jun 22, 2012

I can not explain to you the recursive error, however, I also could not see how your code would work given my understanding of JSL.  The first issue is that the processGCHFile has been specified as passing no variables, while in your code you are passing in 2 values when calling the function.  I therefore commented out the values being passed in, since they are actually indicated as return values.  The second change was just a simple change of "a==1" to allow for the IF() function to trigger.  Finally, I more specifically created the returning list, and then made sure to have it's value being the last processed value, to ensure that it is the returned value. 

 

I hope I am understanding the issue and  this is helpful to you. 

Jim
laisteve17

Occasional Contributor

Joined:

Jun 15, 2017

Thanks, Jim! I see your concern and your response was helpful to me :). I was trying to comment out sections of code to reduce clutter. I ruled out those sections as possible problem points. Like you said, making sure the values are returned (evalList) worked!