UX improvement: remove ambiguity between commands and variable names
Closed this issue · 2 comments
A story
If I want to print the variable a
, I type "a". If I want to print the variable b
I type "b". If I want to print the variable c
I type "c"...
whoops, I just ran the continue command instead of printing my variable.
The problem
godebug lets you print variables by typing their name. But if you build that habit and then want to print a variable with the same name as a godebug command, you will probably run a command you do not intend to, by accident. godebug should either detect the ambiguity or, preferably, not take inputs that can be ambiguous in this way.
The easiest thing is probably to only print variables when the user types the "(p)rint" command.
Questions
What command syntax should we use when godebug is expanded to evaluate full expressions?
How do other debuggers handle this? In particular, what does pdb do?
Agreed, I'm fine with typing "p foo" to print.
Resolved in 070b120