matchfix operator declaration



Dear Robert,

Many thanks for clarification!
I wonder if it can be inserted in the manual just 
after the mentioned point. 

cheers
Valery
 Monday 10 September 2007 23:37:37 Robert Dodier wrote:
> On 9/9/07, Valery Pipin <pip at iszf.irk.ru> wrote:
> > I wonder if I can reformulate  the following  part of Rules.texi:
> > @code{matchfix (@var{ldelimiter}, @var{rdelimiter}, @var{arg_pos},
> > @var{pos})} declares the argument part-of-speech @var{arg_pos}
> > and result part-of-speech @var{pos},
> > and the delimiters @var{ldelimiter} and @var{rdelimiter}.
> >
> > what is "part-of-speech" here?  Is it just a "class" of arguments and
> > results?
>
> Well, "part of speech" is a rather suggestive term, but only 3
> values are recognized --- 'expr 'clause 'any --- 'expr indicating
> an algebraic expression, 'clause indicating a Boolean expression,
> and 'any indicating any kind of expression. Probably the text for
> the other operator declaration functions could be clarified with
> this info as well.
>
> The Maxima parser uses the part of speech declarations to detect
> some syntax errors.
>
> matchfix ("~", "~", expr, expr);
> if ~ 1, 2 ~ then foo else bar;
>  => Incorrect syntax: Found algebraic expression where logical
> expression expected
>
> matchfix ("~", "~", expr, clause);
> if ~ 1, 2 ~ then foo else bar;
>  => OK
>
> I think the parser fails to detect some such errors, however.
>
> matchfix ("~", "~", clause, expr);
> ~ 1, 2 ~ + 1;
>  => OK (hmm, shouldn't that trigger an error?)
>
> HTH
>
> Robert Dodier