Menu

#10 add 'unset' command

syntax improvements
open
None
4
2002-02-04
2002-02-04
Dan Kelley
No

IDEA. It might be nice [DO OTHERS THINK SO??] if the
'set' commands had corresponding 'unset' commands.
These unset commands would un-do the setting, just like
un-doing in an editor.

JUSTIFICATION. This could be nice since it would
prevent always having to save values, when they are to
be temporarily adjusted. For example, one might do

set line width 2
draw curve
unset line width

to draw a curve of the indicated line width, and then
returning to the original line width. The alternative
right now is to save the line width into a variable,
but that requires knowing the name of the internal
variable (..linewidth..), saving this value temporarily
(without over-riding any other temporary values), etc.

IMPLEMENTATION. Internally, gri would maintain a stack
of values, for a given item [e.g. line width]. The
'set' commands would add onto the stack, while the
'unset' would strip off the last value. (I'd make it
so that 'unset' could never remove the initial,
default, value.)

REQUEST. Please comment, in this forum, on whether
this seems like a good idea.

Discussion


Log in to post a comment.