|
From: Daniel J S. <dan...@ie...> - 2007-06-11 18:26:40
|
Petr Mikulik wrote:
>>>>Several of these options may be overridden by similar qualifiers in the
>>>>history command.
>>>> set history {<int>}
>>>
>>>I tried that "set history -1" makes an error.
>>
>>gnuplot> set history -1
>> ^
>> Unrecognized option.
>>
>>Are you getting something else?
>
>
> I get the same.
>
>
> Of course, that means the following also
>
>
>>Should we be recognizing the sign and then issuing an error if negative?
>
>
> Yes.
I began programming this, but now I hesitate to do so. It would be something like
n = 1;
if (equals(c_token,"-")) {
n *= -1;
c_token++;
} else if (equals(c_token,"+"))
c_token++;
n *= int_expression();
But to repeat this code in more than one spot wouldn't be good. There should
maybe be "signed_expression()" inside parse.h.
However, on second thought, just leaving it as is makes the user be a little
cleaner in their use of integers. I don't think it is good practice for users
to be doing
set history +3
etc. That simply clutters things. I suggest leaving it as is with the
"Unrecognized option" error.
Dan
|