some thoughts about rempart



I agree that the definition of rempart in functs.mac is an abomination.
 Why not just re-write it in Lisp?

By the way, with your current definition, 'rempart' acts as though
inflag=true, thus:

           part(1/(a*b),2) => a*b
           part(1/(a*b),2),inflag=true => 1/b
           rempart(1/(a*b),2) => 1/a    <<< consistent with inflag=true

It doesn't seem desirable for rempart to be inconsistent with part.  But
then, I guess it's already inconsistent in its treatment of the 'part'
argument, treating it as a range rather than a list....

            part([a,b,c,d],[1,3]) => [a,c]
            rempart([a,b,c,d],[1,3]) => [d]

Yuck.

              -s


On Sat, Sep 1, 2012 at 4:25 PM, Jean-Claude ARBAUT <
jeanclaudearbaut at orange.fr> wrote:

> >
>
> > rempart(e, n) := block(
> >    [p, q, left, right, v: aux2(e), m],
> >    m: length(v),
> >    if listp(n) then [p, q]: n else p: q: n,
> >    if p = 1 then left: [] else left: rest(v, -m + p - 1),
> >    if q = m then right: [] else right: rest(v, q),
> >    if p = 1 and q = m then right: rest(e, q) else aux1(e, left, right))$
>
> >
>
>
>
>
>
> Since we convert to a list, the 2nd and the 3rd "if" are not necessary:
>
>
>
> rempart(e, n) := block(
>    [p, q, v: aux2(e), m],
>
>    if listp(n) then [p, q]: n else p: q: n,
>    if q = (m: length(v)) and p = 1 then rest(e, q) else aux1(e, rest(v, -m
> + p - 1), rest(v, q)))$
>
>
>
>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
>