Question: map instead of loops ?

Hi, people say that for-next loops are the worst way to apply repeated operations (why?). Assume i have the list

L:=[1,3,5,6];

and the command line that does some stuff in it :

for i from 1 to nops(L)-1 do
 sqrt(5*L[i]-L[i+1]);
 end do;

Whats a better way to do this? I guess map is useful here, but i cant get it to work.

 

 

 

 

 

 

 

 

 

 

Please Wait...