I suspect that you would be happier writing in lisp, if you want this to be
about as fast as possible, and you have lots of similar things in mind.
(subseq '(a b c d e f g h) 2 4) returns (c d).
You could sort of do this in macsyma by
(%i5) ?subseq([a,b,c,d,e,f,g,h],3,5)
I say sortof because in Maxima, a list is really ((mlist simp) $a $b $c
....)
And you need to put the mlist header back.
So maybe ?cons("[",?subseq([...
But that doesn't quite do it.
> -----Original Message-----
> From: maxima-bounces at math.utexas.edu [mailto:maxima-
> bounces at math.utexas.edu] On Behalf Of sen1 at math.msu.edu
> Sent: Saturday, September 16, 2006 4:27 AM
> To: maxima at math.utexas.edu
> Subject: list question
>
> Hi,
> Is there built-in maxima function which returns a sublist of a given
> list from a certain index to another one?
>
> I saw the 'sublist' command, but it requires a certain predicate to be
> true.
>
> What I want is given by the simple function
>
> my_sublist(list,i,j):= makelist(list[k],k,i,j)$
>
> Is there something which is already there which does this?
>
> I found such things for matrices.
>