<?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: JMP 15 assumes that an l-value in jsl is a column name - is this intended? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JMP-15-assumes-that-an-l-value-in-jsl-is-a-column-name-is-this/m-p/276407#M53619</link>
    <description>&lt;P&gt;I think the behavior depends if global:a already exists. It is annoying.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 30 Jun 2020 23:19:41 GMT</pubDate>
    <dc:creator>Craige_Hales</dc:creator>
    <dc:date>2020-06-30T23:19:41Z</dc:date>
    <item>
      <title>JMP 15 assumes that an l-value in jsl is a column name - is this intended?</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-15-assumes-that-an-l-value-in-jsl-is-a-column-name-is-this/m-p/276387#M53613</link>
      <description>&lt;P&gt;JMP 15 assumes an l-value is a column name. This was not the behavior in earlier versions. Is this intended or is it a bug?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To reproduce:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt=new  table("test");
dt&amp;lt;&amp;lt;new column("a");
a=1;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This gives an error in JMP 15 but not in JMP 14.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 23:30:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-15-assumes-that-an-l-value-in-jsl-is-a-column-name-is-this/m-p/276387#M53613</guid>
      <dc:creator>ThomasZatValcon</dc:creator>
      <dc:date>2023-06-09T23:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: JMP 15 assumes that an l-value in jsl is a column name - is this intended?</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-15-assumes-that-an-l-value-in-jsl-is-a-column-name-is-this/m-p/276398#M53615</link>
      <description>&lt;P&gt;When I startup new sessions in JMP 14.3 and JMP 15.1 and run your script, I get the same error in both versions&lt;/P&gt;
&lt;PRE&gt;Cannot set value for the column 'a' because the row number (0) is not valid.&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Jun 2020 21:51:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-15-assumes-that-an-l-value-in-jsl-is-a-column-name-is-this/m-p/276398#M53615</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-06-30T21:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: JMP 15 assumes that an l-value in jsl is a column name - is this intended?</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-15-assumes-that-an-l-value-in-jsl-is-a-column-name-is-this/m-p/276399#M53616</link>
      <description>&lt;P&gt;Interesting. When I run it in 14.3.0 I do not get the error. I do not have earlier versions installed.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2020 21:55:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-15-assumes-that-an-l-value-in-jsl-is-a-column-name-is-this/m-p/276399#M53616</guid>
      <dc:creator>ThomasZatValcon</dc:creator>
      <dc:date>2020-06-30T21:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: JMP 15 assumes that an l-value in jsl is a column name - is this intended?</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-15-assumes-that-an-l-value-in-jsl-is-a-column-name-is-this/m-p/276403#M53618</link>
      <description>&lt;P&gt;you need&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;it's annoying - I don't know if it is intentional; I would prefer it if variables were only scoped as column name if prefixed with a colon (i.e. :a).&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2020 23:09:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-15-assumes-that-an-l-value-in-jsl-is-a-column-name-is-this/m-p/276403#M53618</guid>
      <dc:creator>David_Burnham</dc:creator>
      <dc:date>2020-06-30T23:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: JMP 15 assumes that an l-value in jsl is a column name - is this intended?</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-15-assumes-that-an-l-value-in-jsl-is-a-column-name-is-this/m-p/276407#M53619</link>
      <description>&lt;P&gt;I think the behavior depends if global:a already exists. It is annoying.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2020 23:19:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-15-assumes-that-an-l-value-in-jsl-is-a-column-name-is-this/m-p/276407#M53619</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2020-06-30T23:19:41Z</dc:date>
    </item>
    <item>
      <title>Re: JMP 15 assumes that an l-value in jsl is a column name - is this intended?</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-15-assumes-that-an-l-value-in-jsl-is-a-column-name-is-this/m-p/276420#M53622</link>
      <description>&lt;P&gt;I also ran this incorrectly in version 14.3.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2020-07-01_09-24.png" style="width: 460px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/24920i1A536B3BF69FAD5A/image-size/large?v=v2&amp;amp;px=999" role="button" title="2020-07-01_09-24.png" alt="2020-07-01_09-24.png" /&gt;&lt;/span&gt;&lt;BR /&gt;The only way to avoid this error is to remember that the variable name cannot be the same as the column name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2020 01:27:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-15-assumes-that-an-l-value-in-jsl-is-a-column-name-is-this/m-p/276420#M53622</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2020-07-01T01:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: JMP 15 assumes that an l-value in jsl is a column name - is this intended?</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-15-assumes-that-an-l-value-in-jsl-is-a-column-name-is-this/m-p/276424#M53625</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/12538"&gt;@lwx228&lt;/a&gt;&amp;nbsp; is incorrect.&amp;nbsp; One can have a variable and a column with the same name.&amp;nbsp; It is actually just a matter of scoping the name correctly, so JMP knows which you are talking about&lt;/P&gt;
&lt;P&gt;Take the following script&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt=new table("Example", new column("A") );
dt &amp;lt;&amp;lt; add rows(1);

a = 13;
:: a =47;
:a[1] = a;

show(a,::a,:a[1],dt:a[1]);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It results in&lt;/P&gt;
&lt;PRE&gt;a = 47;
a = 47;
:A[1] = 47;
dt:a[1] = 47;&lt;/PRE&gt;
&lt;P&gt;What is going on here is that actually, all variables and columns have a 2 part name, separated by a colon ":"&lt;/P&gt;
&lt;PRE&gt;namespace:name&lt;/PRE&gt;
&lt;P&gt;and by default, if only a name is given such as in the assignment statement&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;a = 13;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;it is assumed that "a" is a variable.&amp;nbsp; If a colon is placed in front of the variable name,&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;:a[1] = a;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;it is assumed one is referring to a column.&amp;nbsp; In the above example the 1st row in the column named "a" will be given the current value (13) of the variable named "a".&lt;/P&gt;
&lt;P&gt;One can also provide the complete 2 part name for a variable and a column.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For variables, the default namespace (first part of the name) is called ":".&amp;nbsp; That's right, a colon, so the full proper name for the variable "a" is&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;::a&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;you can see the results of using the full name in the Show() statement and it's results&lt;/P&gt;
&lt;P&gt;The full proper name for a column in this little script, is made up of the pointer variable assigned to the data table, and the actual data table column name&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt:a&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The Show() statement also illustrates the 2 part name usage for a column&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this has not just confused everyone, but instead has given some insight&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2020 02:44:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-15-assumes-that-an-l-value-in-jsl-is-a-column-name-is-this/m-p/276424#M53625</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-07-01T02:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: JMP 15 assumes that an l-value in jsl is a column name - is this intended?</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-15-assumes-that-an-l-value-in-jsl-is-a-column-name-is-this/m-p/276712#M53701</link>
      <description>&lt;P&gt;Hi txnelson&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the great explanation. Had not thought about the first : in :: to refer to the global namespace. I must have been wrong with 14.3. When I try now, I get the warning too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You wrote "&lt;SPAN&gt;and by default, if only a name is given such as in the assignment statement".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is also what I expected, but if a column in a data table has the same name, JMP clearly assumes it should assign the value to the&amp;nbsp; column.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Seems names default to here(1) fixes that behaviour as David pointed out. I always waited with defaulting names to the here namespace because it makes debugging more cumbersome. But from now on, I will always use this option from the start!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I hope the JMP team will change that behaviour, because it can create some really hard to find bugs! Especially, if a script actually refers to columns without :'s !&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jul 2020 20:54:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-15-assumes-that-an-l-value-in-jsl-is-a-column-name-is-this/m-p/276712#M53701</guid>
      <dc:creator>ThomasZatValcon</dc:creator>
      <dc:date>2020-07-02T20:54:17Z</dc:date>
    </item>
  </channel>
</rss>

