Created
November 24, 2020 10:52
-
-
Save lokedhs/bb552a05a6cb902a7fe730bf476d3ec1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(clim:define-command-table maxima-commands | |
:inherit-from (maxima-client.markup:text-commands | |
expression-commands | |
maxima-client.workbench:workbench-commands | |
watcher-commands | |
maxima-client.canvas:canvas-commands)) | |
(clim:define-command (plot2d-with-range :name "Plot 2D" :menu t :command-table maxima-commands) | |
((expression maxima-native-expr :prompt "Expression") | |
(variable maxima-native-expr :prompt "Variable") | |
(lower-bound maxima-native-expr :prompt "Lower bound") | |
(upper-bound maxima-native-expr :prompt "Upper bound")) | |
(let ((plot2d-expression `((maxima::$plot2d) ,(maxima-native-expr/expr expression) | |
((maxima::mlist) | |
,(maxima-native-expr/expr variable) | |
,(maxima-native-expr-as-float lower-bound) | |
,(maxima-native-expr-as-float upper-bound))))) | |
(maxima-eval (make-instance 'maxima-native-expr :expr plot2d-expression)))) | |
(clim:make-command-table 'maxima-menubar-command-table | |
:errorp nil | |
:menu '(("File" :menu maxima-file-command-table) | |
("Algebra" :menu maxima-algebra-command-table) | |
("Matrix" :menu maxima-matrix-command-table) | |
("Plot" :menu maxima-plot-command-table) | |
("Lisp" :menu maxima-lisp-command-table) | |
("Display" :menu maxima-interaction-command-table) | |
("Watcher" :menu maxima-watcher-command-table) | |
("Canvas" :menu maxima-client.canvas:maxima-canvas-command-table) | |
("Help" :menu maxima-help-command-table))) | |
(clim:make-command-table 'maxima-plot-command-table | |
:errorp nil | |
:menu '(("Discrete" :command `(plot2d-with-range | |
,clim:*unsupplied-argument-marker* | |
,clim:*unsupplied-argument-marker* | |
,clim:*unsupplied-argument-marker* | |
,clim:*unsupplied-argument-marker*)) | |
("Parametric" :command plot2d-with-range) | |
("Plot example" :command plot2d-demo))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reduced version with different cases of supplied and unsupplied arguments: