Fatal JMP16 bugThis isn't a question, just brining awareness to an issue that I recently noticed within my scripts since moving to JMP16 -- namely, I'd assume that Is Namespace( ... ) would not return a truthy value for a deleted namespace, but it does in JMP16.2 (but not in JMP14.3)
Because of this, the following script crashes JMP16.2:
ns = New Namespace();
ns:ns = New Namespace();
ns:ns << Delete Namespace();
Show( Is Namespace( ns:ns ) );
If( Is Namespace( ns:ns ),
ns:ns:__item__ = 4;
);
I've needed to modify my scripts to the equivalent of this to get around the issue:
ns = New Namespace();
ns:ns = New Namespace();
ns:ns << Delete Namespace();
Show( Is Namespace( ns:ns ) );
If( Is Namespace( ns:ns ) & !Is Missing( ns:ns << Get Name ),
ns:ns:__item__ = 4;
);
Automation and ScriptingRe: Fatal JMP16 bugany update here?
sounds like a candidate for Tiny Traps in Jmp and JSL ...
Re: Fatal JMP16 bugActually I just remembered why -- Namespace Exists will look at the value of the variable and tell you whether the value can represent a namespace, whereas Is Namespace should tell whether the variable is directly a namespace or namespace reference:
Because of this, this code fails:
ns = New Namespace( "test ns" );
ns:item = "variable";
ns name = "test ns";
If( Namespace Exists( ns name ),
Show( ns name:item )
);
Whereas this doesn't:
ns = New Namespace( "test ns" );
ns:item = "variable";
ns name = "test ns";
If( Is Namespace( ns name ),
Show( ns name:item )
);
Re: Fatal JMP16 bugHaha, I didn't read your post very carefully! You're right that this does seem to work, but I have a vague feeling that I didn't use this method for some reason in my code, although I cannot remember why right now.
Re: Fatal JMP16 bugI meant Namespace Exists() which seems to differ from Is Namespace (or maybe I'm missing something here)
Names Default To Here(1);
Clear Log();
Delete Namespaces();
ns = New Namespace();
ns:ns = New Namespace();
Show(Namespace Exists(ns:ns), Is Namespace(ns:ns));
ns:ns << Delete Namespace();
Show(Namespace Exists(ns:ns), Is Namespace(ns:ns));
/*Namespace Exists(ns:ns) = 1;
Is Namespace(ns:ns) = 1;
Namespace Exists(ns:ns) = 0;
Is Namespace(ns:ns) = 1;*/
Re: Fatal JMP16 bug@jthi , it does for a bare namespace, but not when giving a scoped namespace as this shows:
ns = New Namespace();
ns:ns = New Namespace();
ns:ns << Delete Namespace();
Show( Is Namespace( ns:ns ) );
Re: Fatal JMP16 bugThanks very much for this information. A JMP developer has investigated and logged the issues you found so that they can be corrected in a future release!
Re: Fatal JMP16 bugThanks for finding this. I was able to replicate this and I have submitted the report to JMP support for investigate.
Dan
JMP Product Management.
Re: Fatal JMP16 bugNice catch! Hope it isn't too late for the next 17 beta.
Re: Fatal JMP16 bugNamespace Exists() seems to return 0 for deleted namespace.
Re: Fatal JMP16 bugYeah, I reported it today as well. I'll post here any updates -- but I assume that the team is probably aware of the issue already.
Re: Fatal JMP16 bugHas this been reported to the JMP Support folks?