How to assign partial list



>   I have a list, created by a cf(x)-function-call.
>   I want to use only the first n-entries of the list.

rest(list,n) removes the first n elements of a list and
rest(list,-n) removes the last n entries in the list.

So you could define:

  firstn(l,n):=rest(l,n-length(l))$

or use the makelist function:

  makelist(a[i],i,1,n)

----------------

Now switching to a design discussion....

There are several directions this could go.

In terms of the existing list manipulation functions, it would make
sense to define First and Last as having an optional second argument:
First(l,n) (n>=0) would be the first n elements, and First(l,n) (n<=0)
would be the last n elements.  Last(l,n)==First(l,-n).  This would be
trivial to add if people think it's a good idea.

Adding array slices would be another direction to extend things.  In
that case, you'd want not just x: a[i..j], but also a[1..i]:
b[j..j+i-1].  Similarly a[i..j,m..n] for arrays.  This is not rocket
science, just a little careful design and then "a small matter of
programming".