Leo calculator `Alt-X {arbitrary math function}`
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
leo-editor |
Confirmed
|
Wishlist
|
Unassigned |
Bug Description
From Matt Wilke - great idea, math expressions in the mini-buffer should be evaluated and the answer shown in the log window.
Math expressions could be identified by starting with a number, although the system could be more powerful if they were explicitly identified with a leading ? or something, so in the spirit of vs-eval in valuespace.py, Alt-X ?a=7*6 would assign 42 to a and display 42 in the log, and a subsequent Alt-X ?a*10 would display 420 in the log.
So, Alt-X [-+0-9].* implies a math expression, and Alt-X ?.* explicitly announces a math expression.
Of course, for 'math', substitute 'python'.
Finally, I think this could be implemented using the vs-eval code directly, although that raises questions about making the plugin on be default.
Changed in leo-editor: | |
status: | New → Confirmed |
On Tue, Nov 19, 2013 at 1:35 PM, tbnorth <email address hidden> wrote:
>
> Math expressions could be identified by starting with a number, although
>
> the system could be more powerful if they were explicitly identified
>
> with a leading ? or something, so in the spirit of vs-eval in
> valuespace.py, Alt-X ?a=7*6 would assign 42 to a and display 42 in the
>
> log, and a subsequent Alt-X ?a*10 would display 420 in the log.
>
Overloading the Alt-X command is dubious: a calculator is not that often
used.
But Alt-X calc <return> followed by, say, an integral to evaluate (again,
in the minibuffer) would make perfect sense ;-)
EKR