Bug report



I have a recursive function, which modifies its input variable, ind.

charsets_subrank ( f,g,ord,ind ):=block( [ cf,cg],
      cf : charsets_class ( f, ord )  ,
      cg : charsets_class ( g, ord )  ,
      if cf = 0 then (
            if cg = 0 then (ind :: 1) , TRUE)
         else if cf < cg then ( TRUE)
         else if cf = cg then (
            cf : charsets_degreel ( f, ord )  ,
            cg : charsets_degreel ( g, ord )  ,
            if cf < cg then ( TRUE)
               else if cf = cg then (
                  charsets_subrank ( charsets_initial ( f, ord ) ,
                       charsets_initial ( g, ord ) , ord, ind ) )
               else ( FALSE))
         else ( FALSE)
)$

Following your sugestion, I renamed ind to ?ind.
However, could you explain what dynamic scope means in this context?
Dan Stanger

Richard Fateman wrote:

I'm not sure it is a bug since it seems to do what I expected
it to do (it is a consequence of Macsyma generally using
"dynamic scope").

Maybe the question is, what do you really want to do?

One change would be to define f(?funny_name):=?funny_name::1;
to avoid the name coincidence.
Another is to use a macro definition  f(x)::= ... with a
suitable right hand side.  I'm not sure what exactly that should
be though. The describe(macros) command in xmaxima comes up
blank.


Dan Stanger wrote:

> The following is a problem with both maxima 5.5 and the commercial
> macsyma.  What would it
> take to fix it?
> Dan Stanger
> (C1) f(x):=x::1;
> (D1)       f(x) := x :: 1
> (C2) f(x);
> (D2)       1
> (C3) x;
> (D3)       x
> x is not assigned to.
> (C4) y;
> (D4)       y
> (C5) f(y);
> (D5)       1
> (C6) y;
> (D6)       1
> However y is.
>