Variable deletion from command line
Hi,
Is there a way to delete a variable from the command line ? If not, maybe we should implement it ?
Have a nice day, Hadrien
Comments (9)
-
repo owner -
It shouldn't be that hard to implement. Should we?
-
may I suggest a different syntax? Namely
del symbol
. This would differentiate it from the usual functions. -
FWIW,
unset
sounds better to me. Implementing it as a builtin function is easier, but I'm not against a new keyword. We should make sure it is not part of an expression though (e.g.,unset var1 + 2
or2 + unset var1
should fail), which might be easier to do with a keyword. -
repo owner I like
unset
. Still not sure about the "simplified syntax" nature of it. -
My idea was to clearly differentiate it from the ordinary functions (that return a value) from these commands that affect the application.
Other commands that I have in mind:
clear
, orclear history
clear functions
clear variables
set angleMode radians
Those are just ideas, I dunno.
We'd probably best send the input through some sort of special command parser, rather than have this integrated into the evaluator.
-
repo owner Maybe prefix commands with
:
Vim-style. -
repo owner - changed status to open
-
repo owner - Log in to comment
No. I've considered adding a
del(symbol)
function in the past.