<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Python &amp;amp; JSL function in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Python-amp-JSL-function/m-p/911743#M107119</link>
    <description>&lt;P&gt;A bug. &amp;nbsp;JMP 19?&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Paul_Nelson_0-1762441906483.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/86527i42BCD38206CF6C68/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Paul_Nelson_0-1762441906483.png" alt="Paul_Nelson_0-1762441906483.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I was able to recreate what I was seeing from Python, with just running from JSL.&lt;/P&gt;</description>
    <pubDate>Thu, 06 Nov 2025 15:13:08 GMT</pubDate>
    <dc:creator>Paul_Nelson</dc:creator>
    <dc:date>2025-11-06T15:13:08Z</dc:date>
    <item>
      <title>Python &amp; JSL function</title>
      <link>https://community.jmp.com/t5/Discussions/Python-amp-JSL-function/m-p/911687#M107109</link>
      <description>&lt;P&gt;From&amp;nbsp;&lt;LI-MESSAGE title="Python in JMP: dataframe column to datatable column best practices and computation speed implications" uid="910626" url="https://community.jmp.com/t5/Discussions/Python-in-JMP-dataframe-column-to-datatable-column-best/m-p/910626#U910626" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;I just learned about this nice new function:&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;import jmp

jmp.globals['pi'] = 3.1415927
jmp.globals['bB'] = 'Bumble Bee'
print( jmp.globals.items() )
&lt;/LI-CODE&gt;
&lt;P&gt;to define variables in the JSL namespace - like a push version of &lt;FONT face="courier new,courier"&gt;Python Get()&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are some restrictions. E.g. , at the moment &lt;FONT face="courier new,courier"&gt;jmp.globals&lt;/FONT&gt; doesn't know JSL functions:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;::f= function({x},x);
x="hello";
y=5;
z={1,2,3};
aa= associative Array({1,2});
Python Submit("
import jmp
print(jmp.globals)");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;the response:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_0-1762428834857.png" style="width: 917px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/86513iD5BEC09F56DEA53A/image-dimensions/917x33?v=v2" width="917" height="33" role="button" title="hogi_0-1762428834857.png" alt="hogi_0-1762428834857.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe a related issue? :&lt;BR /&gt;The attempt to create a function via run_jsl with this JSL code:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;import jmp
jmp.run_jsl('x="hello";Caption(x)') # OK
jmp.run_jsl('f= function({x},x)')   # crash
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;FONT size="5" color="#FF0000"&gt;&lt;STRONG&gt;...&amp;nbsp; leads to a crash!?!&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;when you run the code line by line, you will get this error message:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_2-1762425301770.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/86511i21402F7384A117DF/image-size/large?v=v2&amp;amp;px=999" role="button" title="hogi_2-1762425301770.png" alt="hogi_2-1762425301770.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Nov 2025 11:34:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Python-amp-JSL-function/m-p/911687#M107109</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2025-11-06T11:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: Python &amp; JSL function</title>
      <link>https://community.jmp.com/t5/Discussions/Python-amp-JSL-function/m-p/911743#M107119</link>
      <description>&lt;P&gt;A bug. &amp;nbsp;JMP 19?&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Paul_Nelson_0-1762441906483.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/86527i42BCD38206CF6C68/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Paul_Nelson_0-1762441906483.png" alt="Paul_Nelson_0-1762441906483.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I was able to recreate what I was seeing from Python, with just running from JSL.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Nov 2025 15:13:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Python-amp-JSL-function/m-p/911743#M107119</guid>
      <dc:creator>Paul_Nelson</dc:creator>
      <dc:date>2025-11-06T15:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: Python &amp; JSL function</title>
      <link>https://community.jmp.com/t5/Discussions/Python-amp-JSL-function/m-p/911776#M107128</link>
      <description>&lt;P&gt;Yes,&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/26800"&gt;@hogi&lt;/a&gt;&amp;nbsp;is running JMP 19.0.1. He sent an email to support asking if this was a known bug.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Nov 2025 16:59:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Python-amp-JSL-function/m-p/911776#M107128</guid>
      <dc:creator>Dahlia_Watkins</dc:creator>
      <dc:date>2025-11-06T16:59:09Z</dc:date>
    </item>
    <item>
      <title>Re: Python &amp; JSL function</title>
      <link>https://community.jmp.com/t5/Discussions/Python-amp-JSL-function/m-p/911852#M107133</link>
      <description>&lt;P&gt;Same issue with JMP19 and JMP19.0.1 (Windows version).&lt;BR /&gt;With JMP 18, there is no issue.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Interesting that&amp;nbsp;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;eval(f = function({x},x))&lt;BR /&gt;&lt;/FONT&gt;is different from&amp;nbsp;&lt;FONT face="courier new,courier"&gt;&lt;BR /&gt;f = function({x},x).&lt;BR /&gt;&lt;/FONT&gt;So, it evaluates the argument before evaluating the return value of the argument?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Eval(print(1);Parse("print(2)"));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;Significantly different:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;with the Python code, JMP crashes on my system (maybe there is a difference between Win and Mac?)&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;with&amp;nbsp;&lt;FONT face="courier new,courier"&gt;eval(f = function({x},x))&lt;FONT face="arial,helvetica,sans-serif"&gt;&amp;nbsp;JMP shows a JMP alert and continues alive:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_0-1762460875004.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/86553i3E7E7BEB1DECEB24/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_0-1762460875004.png" alt="hogi_0-1762460875004.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Nov 2025 21:12:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Python-amp-JSL-function/m-p/911852#M107133</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2025-11-06T21:12:44Z</dc:date>
    </item>
  </channel>
</rss>

