kill(all)$

maxima : programming list operations ,version 1.0
peter.vlasschaert@gmail.com,21/10/2019

load 'packages'

load(lrats);

p1:makelist(concat(x,i),i,1,10);

p1a:map(concat,[x,x,x],[1,2,3]);

concat : 'use to make strings'

sequence
========

p2:makelist(i,i,1,10);

list random numbers :
================

ss: make_random_state (false)$

ref : general commands

p2a1:makelist(random(10),i,1,10);

general 'commands'
================
'reverse' ,'first','second' , ...., 'rest','last','length'

p2a2:reverse(p2a1);

p2a3:first(p2a1);

p2a4:rest(p2a1);

p2a4:last(p2a1);

p2a5:p2a1[5];

p2a8:length(p2a1);

connect 'atom' to numbers
====================

p:map("=",p1,p2);

rem :subst,lratsubst ' see load'

pa:lratsubst(p, 2*x1+x5-3*x10);

change connection to a 'asign operator' can be used , 'ev'
============================================

p1:["="=":"];

p2:subst(p1,p);

p3:makelist(ev(p2[i]),i,1,length(p2));

apply operator :
============
between

p4:apply("+",p3);

other use:apply
============

p4aa:apply(max,p3);

p4bb:apply(concat,p3);

Note that although concat  looks like a number, it is a Maxima string. 

properties(p4bb);

p4cc:p4bb+1.0,numer;

apply operator :
============
on each element of the list

p4a:map(sin,p3);

p4a1:float(p4a);

p4b:maplist(sin,p3);

p4b1:listp(p4b);

p4b2:map("+",[1,2,3],[4,5,6]);

rem :

syntax
=====

use : subst([eq1,eq2,....],expression) , see 'above'                           => sequentially substitutions
use : sublis([sym1=expression1,sym2=expression2,......],form)      => parallel         substitutions
' symi ' must be atomic variable.

example : relation between

sequentially: subst
=========

q:subst([i=j,j=i],x[i,j]);

rem : subst  : 'left' to the 'right',sequence
rem :lratsubst : 'load needed'

parallel : sublis
======

q1:sublis([i=j,j=i],x[i,j]);

how convert : list <= >matrix
======================

list to matrix
-----------------

p5:[[1,2,3],[4,5,6],[7,8,9]];

p5a:apply('matrix,p5);

p5a1:p5a[3][3];

matrix to list
-----------------
use : 'p5a'

p5b:args(p5a);

p5b1:p5b[2];

p5b2:p5b[2][1];

see: internet
==========

https://stackoverflow.com/questions/8688906/maxima-convert-matrix-to-list

DataL : [[1, 2], [2, 4], [3, 6], [4, 8]];  /* Using your example list */
DataM : apply('matrix, DataL);              /* and matrix             */

DataML : makelist(list_matrix_entries(row(DataM, i)), i, 1, 4);
is(DataML = DataL);   /*  true  */

example :map,fullmap,scanmap.
=========================

p6:[[a,b,c],[d,e],f];

p6a:map(g,p6);

p6a:fullmap(g,p6);

p6a:scanmap(g,p6);

numfactor,maplist
==============

p7:3*x^2-2*x+6;

p7a:maplist(numfactor,p7);

p8:args(p7);