<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, Is there a simpler a way?</title>
    <link>http://www.mapleprimes.com/questions/35611-Is-There-A-Simpler-A-Way</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Tue, 09 Jun 2026 10:20:15 GMT</lastBuildDate>
    <pubDate>Tue, 09 Jun 2026 10:20:15 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, Is there a simpler a way?</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, Is there a simpler a way?</title>
      <link>http://www.mapleprimes.com/questions/35611-Is-There-A-Simpler-A-Way</link>
    </image>
    <item>
      <title>for example</title>
      <link>http://www.mapleprimes.com/questions/35611-Is-There-A-Simpler-A-Way?ref=Feed:MaplePrimes:Is there a simpler a way?:Comments#answer44434</link>
      <itunes:summary>&lt;pre&gt;
L:=[1,2,3,4,5];
&amp;nbsp;
seq(L[i], i =3 .. nops(L)); # the seq, except the first 2
L[1], L[2]; # the first 2 
[%%, %]; # put them together and make it a list

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [3, 4, 5, 1, 2]

&lt;/pre&gt;
&lt;p&gt;For the 2nd question you may wish to state what you want instead of posting the result or code.&lt;/p&gt;</itunes:summary>
      <description>&lt;pre&gt;
L:=[1,2,3,4,5];
&amp;nbsp;
seq(L[i], i =3 .. nops(L)); # the seq, except the first 2
L[1], L[2]; # the first 2 
[%%, %]; # put them together and make it a list

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [3, 4, 5, 1, 2]

&lt;/pre&gt;
&lt;p&gt;For the 2nd question you may wish to state what you want instead of posting the result or code.&lt;/p&gt;</description>
      <guid>44434</guid>
      <pubDate>Tue, 02 Mar 2010 02:30:53 Z</pubDate>
      <itunes:author>Axel Vogt</itunes:author>
      <author>Axel Vogt</author>
    </item>
    <item>
      <title>rotate a list</title>
      <link>http://www.mapleprimes.com/questions/35611-Is-There-A-Simpler-A-Way?ref=Feed:MaplePrimes:Is there a simpler a way?:Comments#answer44435</link>
      <itunes:summary>&lt;p&gt;It might be more natural to swap the polarity, but here is a routine you can use to rotate left/right.&lt;/p&gt;
&lt;pre&gt;
Rotate := proc(L, i::integer) 
local k;
&amp;nbsp;&amp;nbsp;&amp;nbsp; k := modp(i,nops(L)); 
&amp;nbsp;&amp;nbsp; [L[k+1..][], L[..k][]]; 
end proc:
&lt;/pre&gt;
&lt;pre&gt;
L := [1,2,3,4,5]:
Rotate(L, 2);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [3, 4, 5, 1, 2]
&lt;/pre&gt;
&lt;pre&gt;
Rotate(L, -2);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [4, 5, 1, 2, 3]



&lt;/pre&gt;</itunes:summary>
      <description>&lt;p&gt;It might be more natural to swap the polarity, but here is a routine you can use to rotate left/right.&lt;/p&gt;
&lt;pre&gt;
Rotate := proc(L, i::integer) 
local k;
&amp;nbsp;&amp;nbsp;&amp;nbsp; k := modp(i,nops(L)); 
&amp;nbsp;&amp;nbsp; [L[k+1..][], L[..k][]]; 
end proc:
&lt;/pre&gt;
&lt;pre&gt;
L := [1,2,3,4,5]:
Rotate(L, 2);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [3, 4, 5, 1, 2]
&lt;/pre&gt;
&lt;pre&gt;
Rotate(L, -2);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [4, 5, 1, 2, 3]



&lt;/pre&gt;</description>
      <guid>44435</guid>
      <pubDate>Tue, 02 Mar 2010 02:51:58 Z</pubDate>
      <itunes:author>Joe
 Riel
</itunes:author>
      <author>Joe
 Riel
</author>
    </item>
    <item>
      <title>add row and column of a matrix???</title>
      <link>http://www.mapleprimes.com/questions/35611-Is-There-A-Simpler-A-Way?ref=Feed:MaplePrimes:Is there a simpler a way?:Comments#answer44439</link>
      <itunes:summary>&lt;p&gt;How do i add the elements of a particular row of a matrix. For example if i had a matrix [1,2,3],[234],[375]. The total of the first row would be 6, second row 9 and third 15. &lt;/p&gt;
&lt;p&gt;The first column would be 6, second column 12 and third 12.&lt;br /&gt;
&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To add the diagonal of a matrix would it it be best to convert it to a list then total the list or is there a better way of adding the diagonal of a matrix??&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;How do i add the elements of a particular row of a matrix. For example if i had a matrix [1,2,3],[234],[375]. The total of the first row would be 6, second row 9 and third 15. &lt;/p&gt;
&lt;p&gt;The first column would be 6, second column 12 and third 12.&lt;br /&gt;
&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To add the diagonal of a matrix would it it be best to convert it to a list then total the list or is there a better way of adding the diagonal of a matrix??&lt;/p&gt;</description>
      <guid>44439</guid>
      <pubDate>Tue, 02 Mar 2010 06:11:00 Z</pubDate>
      <itunes:author>Jabz</itunes:author>
      <author>Jabz</author>
    </item>
    <item>
      <title>mutable</title>
      <link>http://www.mapleprimes.com/questions/35611-Is-There-A-Simpler-A-Way?ref=Feed:MaplePrimes:Is there a simpler a way?:Comments#answer44442</link>
      <itunes:summary>&lt;p&gt;The whole approach of using lists for what appears to be a task suited for genuinely mutable data structures is dubious.&lt;/p&gt;
&lt;p&gt;A Maple list is not really a mutable data structure. Sure, you can assign to an entry for lists of length less than a hundred, or subsop into even longer lists. But both those actions actually create wholly new structures, which means creation of more collectible garbage. (It's implemented so as to be convenient, with the replacement with the new object being done nicely and quietly. But it's still producing collectible garbage unnecessarily.) That extra, avoidable memory management cost usually makes the method less efficient than necessary.&lt;/p&gt;
&lt;pre&gt;
&amp;gt; restart:
&amp;gt; L:=[1,2,3,4];
                               L := [1, 2, 3, 4]
 
&amp;gt; addressof(L);
                                    7505560
 
&amp;gt; L[3]:=15:
&amp;gt; L;
                                 [1, 2, 15, 4]
 
&amp;gt; addressof(L);
                                    7505656
&lt;/pre&gt;
&lt;p&gt;If you intend to do a great deal of such entry replacement, and if you want it efficient, then you should likely be using an Array (rtable) or a table instead of a list.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;The whole approach of using lists for what appears to be a task suited for genuinely mutable data structures is dubious.&lt;/p&gt;
&lt;p&gt;A Maple list is not really a mutable data structure. Sure, you can assign to an entry for lists of length less than a hundred, or subsop into even longer lists. But both those actions actually create wholly new structures, which means creation of more collectible garbage. (It's implemented so as to be convenient, with the replacement with the new object being done nicely and quietly. But it's still producing collectible garbage unnecessarily.) That extra, avoidable memory management cost usually makes the method less efficient than necessary.&lt;/p&gt;
&lt;pre&gt;
&amp;gt; restart:
&amp;gt; L:=[1,2,3,4];
                               L := [1, 2, 3, 4]
 
&amp;gt; addressof(L);
                                    7505560
 
&amp;gt; L[3]:=15:
&amp;gt; L;
                                 [1, 2, 15, 4]
 
&amp;gt; addressof(L);
                                    7505656
&lt;/pre&gt;
&lt;p&gt;If you intend to do a great deal of such entry replacement, and if you want it efficient, then you should likely be using an Array (rtable) or a table instead of a list.&lt;/p&gt;</description>
      <guid>44442</guid>
      <pubDate>Tue, 02 Mar 2010 06:41:47 Z</pubDate>
      <itunes:author>pagan</itunes:author>
      <author>pagan</author>
    </item>
    <item>
      <title>oh sory. I was trying to</title>
      <link>http://www.mapleprimes.com/questions/35611-Is-There-A-Simpler-A-Way?ref=Feed:MaplePrimes:Is there a simpler a way?:Comments#comment44436</link>
      <itunes:summary>&lt;p&gt;oh sory. I was trying to make a procedure which swaps the first two elements in the list and shift the third element to the end of the list. My procedure does this but it's quite long. I was wondering if it could be done more efficiently&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;L:= [ 1, 2, 3, 4, 5, 6] = &amp;gt; [ &lt;b&gt;2&lt;/b&gt;, &lt;b&gt;1&lt;/b&gt;, 4 , 5, 6, &lt;b&gt;3&lt;/b&gt;]&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;oh sory. I was trying to make a procedure which swaps the first two elements in the list and shift the third element to the end of the list. My procedure does this but it's quite long. I was wondering if it could be done more efficiently&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;L:= [ 1, 2, 3, 4, 5, 6] = &amp;gt; [ &lt;b&gt;2&lt;/b&gt;, &lt;b&gt;1&lt;/b&gt;, 4 , 5, 6, &lt;b&gt;3&lt;/b&gt;]&lt;/p&gt;</description>
      <guid>44436</guid>
      <pubDate>Tue, 02 Mar 2010 03:01:40 Z</pubDate>
      <itunes:author>Jabz</itunes:author>
      <author>Jabz</author>
    </item>
    <item>
      <title>That's fantastic thank you</title>
      <link>http://www.mapleprimes.com/questions/35611-Is-There-A-Simpler-A-Way?ref=Feed:MaplePrimes:Is there a simpler a way?:Comments#comment44438</link>
      <itunes:summary>&lt;p&gt;That's fantastic thank you&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;That's fantastic thank you&lt;/p&gt;</description>
      <guid>44438</guid>
      <pubDate>Tue, 02 Mar 2010 03:05:25 Z</pubDate>
      <itunes:author>Jabz</itunes:author>
      <author>Jabz</author>
    </item>
  </channel>
</rss>