A symbol table keeps track of all the variables that have ever been set to a value. If a variable has never been set, it is uninitialized, and using it is probably an error.
The builtin isEmpty() function makes special cases out of several unusual situations.
Case 1: variable never used before
Is Empty(neverSeenBefore) = 1;
print(neverSeenBefore)
/*:
Name Unresolved: neverSeenBefore in access or evaluation of 'neverSeenBefore' , neverSeenBefore/*###*/
Name Unresolved means JMP looked in the symbol table and could not locate the name.
Case 2 (normal case): variable set to the value returned by the builtin empty() function, or another function that returned empty()
ev=empty(); show(isempty(ev),ev);
/*:
Is Empty(ev) = 1;
ev = Empty();
If you expect to test for empty, you should use the empty() function to initialize your variables.
Case 3: variable cleared by the builtin clear globals() function
ev2=42; clear globals(ev2); show(isempty(ev2),ev2);
Is Empty(ev2) = 1;
ev2 = ev2;
Using clear globals() isn't a good idea in production code, but can be helpful while developing code. It does NOT remove the symbol from the symbol table but does remove its value, not even leaving empty() for the value. It may act like empty() or missing, depending how it is used.
JSL passes arguments to user written functions by value, making a copy for the function to use. A future version of JMP may allow passing arguments by reference. We'll see what happens with passing uninitialized variables by reference at that point.
Craige