<?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: Insert Into() in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Insert-Into/m-p/554204#M76892</link>
    <description>&lt;P&gt;That is the best you can do if you are happy to update list1.&lt;/P&gt;
&lt;P&gt;If you want a new list, leaving the old lists unchanged, the best choice between these&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;        lnew = l1 || l2 || l3;
// vs
        lnew = insert( l1, l2 ); lnew = insert( lnew, l3 );
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;depends on the length of the lists, though || eventually pulls ahead in the graph below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All three are within a factor of 2 of the same speed. I like insertInto() because it avoids copying list1. I like the || concatenation operator because it is clear what it is doing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="InsertInto wins if you don't mind that it does what its name says." style="width: 726px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/46137i13493EAEC2D92BC7/image-size/large?v=v2&amp;amp;px=999" role="button" title="ListTime.png" alt="InsertInto wins if you don't mind that it does what its name says." /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;InsertInto wins if you don't mind that it does what its name says.&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 10 Oct 2022 01:53:09 GMT</pubDate>
    <dc:creator>Craige_Hales</dc:creator>
    <dc:date>2022-10-10T01:53:09Z</dc:date>
    <item>
      <title>Insert Into()</title>
      <link>https://community.jmp.com/t5/Discussions/Insert-Into/m-p/554198#M76891</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a number of lists, of varying length, and I'd like to combine all the items in the lists into one list.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;list1 = {"a", "b", "c"};
list2 = {"d", "e"};&lt;BR /&gt;list3 = {"f", "g", "h", "i"};&lt;BR /&gt;.... the number of lists ranges from 7 to 10.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Want to create&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;list = {"a", "b", "c",&amp;nbsp;"d", "e"};&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been creating the final list&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Insert Into(list1, list2);
Insert Into(list1, list3);
.... and so on.&amp;nbsp;&lt;BR /&gt;(I&amp;nbsp;don't&amp;nbsp;mind&amp;nbsp;the&amp;nbsp;list&amp;nbsp;items&amp;nbsp;are&amp;nbsp;added&amp;nbsp;to&amp;nbsp;list1)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a more efficient way of doing this? Insert Into() doesn't seem to take more than 1 add-on parameter.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 15:59:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Insert-Into/m-p/554198#M76891</guid>
      <dc:creator>derchieh</dc:creator>
      <dc:date>2023-06-09T15:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: Insert Into()</title>
      <link>https://community.jmp.com/t5/Discussions/Insert-Into/m-p/554204#M76892</link>
      <description>&lt;P&gt;That is the best you can do if you are happy to update list1.&lt;/P&gt;
&lt;P&gt;If you want a new list, leaving the old lists unchanged, the best choice between these&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;        lnew = l1 || l2 || l3;
// vs
        lnew = insert( l1, l2 ); lnew = insert( lnew, l3 );
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;depends on the length of the lists, though || eventually pulls ahead in the graph below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All three are within a factor of 2 of the same speed. I like insertInto() because it avoids copying list1. I like the || concatenation operator because it is clear what it is doing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="InsertInto wins if you don't mind that it does what its name says." style="width: 726px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/46137i13493EAEC2D92BC7/image-size/large?v=v2&amp;amp;px=999" role="button" title="ListTime.png" alt="InsertInto wins if you don't mind that it does what its name says." /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;InsertInto wins if you don't mind that it does what its name says.&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 01:53:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Insert-Into/m-p/554204#M76892</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2022-10-10T01:53:09Z</dc:date>
    </item>
  </channel>
</rss>

