Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There does not seem to be a function to_lisp() #1785

Open
richardgobeli opened this issue Jun 12, 2023 · 8 comments
Open

There does not seem to be a function to_lisp() #1785

richardgobeli opened this issue Jun 12, 2023 · 8 comments

Comments

@richardgobeli
Copy link
Collaborator

My program just hangs up at this point.

image

image

If you don't disable the prompt for lisp-quiet, can you let WxMaxima just ignore the text that comes back from lisp-quiet?

@daute
Copy link
Member

daute commented Jun 21, 2023

There is no to_maxima(). One can switch to Lisp-mode with to_lisp() and return to the "Maxima-mode" using (to-maxima) (a function call in Lisp notation), e.g. - change to Lisp, add 4+4 (in Lisp notation), return to Maxima. Here a sample from command line Maxima.

(%i1) to_lisp();
Type (to-maxima) to restart, ($quit) to quit Maxima.

MAXIMA> (+ 4 4)
8
MAXIMA> (to-maxima)
Returning to Maxima
(%o1)                                true

But it seems not work in a current wxMaxima, you are right. And it seemed to work in older version (19.07.0, included in Ubuntu 20.04).

@richardgobeli
Copy link
Collaborator Author

This is because the lisp-quiet function turns off the prompt. The lisp-quiet function is called sometime during the printing of a cell.
Until the lisp-quiet works to restore the prompt at the end, the other lisp and debug functions should always turn the prompt back on before they start in Maxima so they will end correctly.

@richardgobeli
Copy link
Collaborator Author

I got the to_lisp () function to work when I added the following lines of code at the start of to_lisp.
The function is in the source file init-cl. lisp so I needed to make a dummy function like this.
(defun $to_lis ()
(if (string= mread-prompt "")
(setq mread-prompt lisp-quiet-suppressed-prompt))
($to_lisp ))

However, the lisp-quiet function may still cause issues with follow-up statements in Wxmaxima.

@richardgobeli
Copy link
Collaborator Author

The lisp-quiet function needs to be replaced with a bit bucket in the WxMaxima program and just leave the prompt on.
This would allow all other functions to work correctly.

@gunterkoenigsmann
Copy link
Member

I still hope that one day the Maxima project will make that function work correctly: If we leave the prompt on the input and output label numbers will be a bit unpredictable.

@richardgobeli
Copy link
Collaborator Author

richardgobeli commented Oct 7, 2023

Couldn't you make it just ignore the return text and also ignore the changing of the cell number for the input and output cell labels?
Wxmaxima knows when it sends a LISP command the should be quiet so it can ignore everything for that function when it comes back including changing the cell label numbers. I think this could be done all in the Wxmaxima program.

This would not work if the label count is done in Maxima, but I guess a flag could also be sent to Maxima to not change the cell number.

@gunterkoenigsmann
Copy link
Member

If wxMaxima would display a different label number tha.n the one Maxima assigns to a label users who use the label numbers would complain that %i13 delivers something different to %i13 and that % returns not the last line bit the output from some lisp command.

...and Maxima has a flag that tells not to advance the label numbers and not to remember the current command's output. It is named ,:lisp-quiet and unfortunately is currently broken.

@robert-dodier
Copy link
Collaborator

@gunterkoenigsmann I gather that there is some problem with :lisp-quiet in Maxima; can you please open a bug report on the Maxima bug tracker for that. (I see that there is https://sourceforge.net/p/maxima/bugs/3007/ but it is closed; I assume it was resolved satisfactorily.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants