Re: How to assign partial list



Stavros Macrakis wrote, in part:

> Maxima users are familiar with other languages they use,
> including conventional mathematical notation, other symbolic
> systems (Mathematica, Maple), and numeric systems (Fortran, 
> Matlab, Java, Perl, Python, Excel (!), etc.).  If we're going
> to introduce new notations, we should look at these and other
> languages as a model, not at Common Lisp.

Concerning notation and operations on lists, the "old guard"
of programming languages (Fortran and a lot of stuff derived 
from it -- Basic, C/C++, Java) have a very weak, limited set 
of built-in operations for processing lists. Lisp, I'm sure,
is very powerful, but also very idiosyncratic.

More recent languages -- certainly Perl and Python but also
S and Matlab -- have more interesting operations and
more concise notations.

For example, I do this kind of stuff in Octave every day:
(I'm pretty sure it also works in Matlab)

  mean( a( a > 0 ) )

or

  sum( a( b == 1 ) )

The "a > 0" and "b == 1" expressions construct indices
that are then used to get a subset of a vector "a". Sure, you 
can do it in Fortran or Fortran-alikes -- but I think after
you get used to that kind of all-at-once operation you
won't want to go back to do-loops.

If inspiration for list operations is needed, I'd look
first at Octave/Matlab, then Python. If still more is
needed, I'd look at R/S.

For what it's worth,
Robert Dodier

__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/