[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: proposed parser changes
From: |
Jaroslav Hajek |
Subject: |
Re: proposed parser changes |
Date: |
Thu, 13 Mar 2008 20:06:41 +0100 |
On Thu, Mar 13, 2008 at 7:33 PM, John W. Eaton <address@hidden> wrote:
> I'm thinking about modifying the parser to remove the special "command"
> and "rawcommand" tags for symbols and instead use the surrounding
> context to decide when the parser is looking at a command-style
> function. This change would improve compatibility with Matlab.
>
> I resisted this kind of change in the past because I didn't like the
> following behavior of Matlab:
>
> Given a function foo, the expression
>
> foo -1
>
> would call foo with the character string "-1" as an argument but
>
> foo - 1
> foo-1
> foo- 1
>
> would all call foo with no arguments, then subtract 1 from the value
> it returned.
>
> Now I'm beginning to think the advantage of improved compatibility and
> not having to tag functions as commands outweighs the trouble that
> might be caused by this small inconsistency.
>
> Also, we no longer mark any functions in Octave or Octave Forge with
> the "rawcommand" tag. It was only used to support the special syntax
> used by gset/gplot/gsplot. Now that those are gone I see no reason to
> keep the "rawcommand" tag in any case.
>
> Comments?
>
I think it's a good idea, as writing custom commands previously
required adding mark_as_command to some startup script - I suppose
that will no longer be necessary.
> jwe
>
--
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz