From Python in JMP: dataframe column to datatable column best practices and computation speed implication... I just learned about this nice new function:
import jmp
jmp.globals['pi'] = 3.1415927
jmp.globals['bB'] = 'Bumble Bee'
print( jmp.globals.items() )
to define variables in the JSL namespace - like a push version of Python Get()
There are some restrictions. E.g. , at the moment jmp.globals doesn't know JSL functions:
::f= function({x},x);
x="hello";
y=5;
z={1,2,3};
aa= associative Array({1,2});
Python Submit("
import jmp
print(jmp.globals)");
the response:
Maybe a related issue? :
The attempt to create a function via run_jsl with this JSL code:
import jmp
jmp.run_jsl('x="hello";Caption(x)') # OK
jmp.run_jsl('f= function({x},x)') # crash
... leads to a crash!?!
when you run the code line by line, you will get this error message:
A bug. JMP 19?
I get a different error message on my machine but it appears that the run_jsl() is acting as if an eval(f = function({x},x)) is occurring rather just the assignment.
I was able to recreate what I was seeing from Python, with just running from JSL.
Yes, @hogi is running JMP 19.0.1. He sent an email to support asking if this was a known bug.
Same issue with JMP19 and JMP19.0.1 (Windows version).
With JMP 18, there is no issue.
Interesting that
eval(f = function({x},x))
is different from
f = function({x},x).
So, it evaluates the argument before evaluating the return value of the argument?
Eval(print(1);Parse("print(2)"));
Significantly different: