Variable deletion from command line

Create issue
Issue #604 open
Hadrien Theveneau created an issue


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)

  1. Pol Welter

    may I suggest a different syntax? Namely del symbol. This would differentiate it from the usual functions.

  2. Tey'

    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 or 2 + unset var1 should fail), which might be easier to do with a keyword.

  3. Pol Welter

    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, or clear 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.

  4. Log in to comment