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

Error using question mark abbreviations #106

Open
javi-s opened this issue Dec 2, 2021 · 4 comments
Open

Error using question mark abbreviations #106

javi-s opened this issue Dec 2, 2021 · 4 comments

Comments

@javi-s
Copy link

javi-s commented Dec 2, 2021

I built a Docker image of Maxima-Jupyter from GitHub, editing the Dockerfile to have pacman install help files.

RUN sed -i '/^NoExtract.*usr\/share\/info/d' /etc/pacman.conf

I can use the describe function for help:

describe(erf);

𝐭𝐫𝐮𝐞(%o0)

  There are also some inexact matches for `erf'.
  Try `?? erf' to see them.


 -- Function: erf (<z>)

     The Error Function erf(z) (A&S 7.1.1)

     See also flag 'erfflag'.

But if I try to use a question mark abbreviation, I get a SIMPLE-ERROR: parser: end of file while scanning expression:

??erf
SIMPLE-ERROR: parser: end of file while scanning expression.

3: ((FLET "H1" :IN JUPYTER:EVALUATE-CODE) parser: end of file while scanning expression.)
4: (SB-KERNEL::%SIGNAL parser: end of file while scanning expression.)
5: (CERROR without any special action parser: end of file while scanning expression.)
6: (PEEK-ONE-TOKEN-G NIL NIL)
7: (PARSE $ANY 0)
8: (MREAD-RAW #<FORM-TRACKING-STREAM for "file /tmp/930680F198984DD13F52082FA89DA81F-4138482594.mac" {1005CE6693}> NIL)
9: (MREAD-RAW #<FORM-TRACKING-STREAM for "file /tmp/930680F198984DD13F52082FA89DA81F-4138482594.mac" {1005CE6693}>)
10: (MAXIMA-JUPYTER::MY-MREAD #<FORM-TRACKING-STREAM for "file /tmp/930680F198984DD13F52082FA89DA81F-4138482594.mac" {1005CE6693}>)
11: ((:METHOD JUPYTER:EVALUATE-FORM (MAXIMA-JUPYTER::KERNEL T T T)) #<KERNEL {10058A4E83}> #<FORM-TRACKING-STREAM for "file /tmp/930680F198984DD13F52082FA89DA81F-4138482594.mac" {1005CE6693}> CELL:4138482594.MAC.NEWEST NIL 1 0)
12: (JUPYTER/COMMON-LISP::REPL ??erf CELL:4138482594.MAC.NEWEST NIL)
13: ((:METHOD JUPYTER:EVALUATE-CODE (JUPYTER/COMMON-LISP:KERNEL T)) #<unused argument> ??erf CELL:4138482594.MAC.NEWEST NIL)
14: ((:METHOD JUPYTER:EVALUATE-CODE :AROUND (MAXIMA-JUPYTER::KERNEL T)) #<KERNEL {10058A4E83}> ??erf CELL:4138482594.MAC.NEWEST NIL)
15: (JUPYTER::HANDLE-EXECUTE-REQUEST)
16: (JUPYTER::RUN-SHELL #<KERNEL {10058A4E83}>)
17: ((LAMBDA NIL :IN BORDEAUX-THREADS::BINDING-DEFAULT-SPECIALS))
18: ((FLET SB-UNIX::BODY :IN SB-THREAD::RUN))
19: ((FLET "WITHOUT-INTERRUPTS-BODY-10" :IN SB-THREAD::RUN))
20: ((FLET SB-UNIX::BODY :IN SB-THREAD::RUN))
21: ((FLET "WITHOUT-INTERRUPTS-BODY-3" :IN SB-THREAD::RUN))
22: (SB-THREAD::RUN)
23: ("foreign function: call_into_lisp")
24: ("foreign function: funcall1")

If I use a space after the question mark abbreviation, I get a different error SIMPLE-STREAM-ERROR: #<SB-INT:FORM-TRACKING-STREAM for "file /tmp/930680F198984DD13F52082FA89DA81F-366519187.mac" {10060F87B3}> is not positionable:

?? erf
SIMPLE-STREAM-ERROR: #<SB-INT:FORM-TRACKING-STREAM for "file /tmp/930680F198984DD13F52082FA89DA81F-366519187.mac" {10060F87B3}> is not positionable

3: ((FLET "H1" :IN JUPYTER:EVALUATE-CODE) #<SB-INT:FORM-TRACKING-STREAM for "file /tmp/930680F198984DD13F52082FA89DA81F-366519187.mac" {10060F87B3}> is not positionable)
4: (SB-KERNEL::%SIGNAL #<SB-INT:FORM-TRACKING-STREAM for "file /tmp/930680F198984DD13F52082FA89DA81F-366519187.mac" {10060F87B3}> is not positionable)
5: (ERROR SIMPLE-STREAM-ERROR STREAM #<FORM-TRACKING-STREAM for "file /tmp/930680F198984DD13F52082FA89DA81F-366519187.mac" {10060F87B3}> FORMAT-CONTROL ~@<~?~@[: ~2I~_~A~]~:> FORMAT-ARGUMENTS (~S is not positionable (#<FORM-TRACKING-STREAM for "file /tmp/930680F198984DD13F52082FA89DA81F-366519187.mac" {10060F87B3}>) NIL))
6: (SB-IMPL::TRACKING-STREAM-MISC #<FORM-TRACKING-STREAM for "file /tmp/930680F198984DD13F52082FA89DA81F-366519187.mac" {10060F87B3}> 6 0)
7: (FILE-POSITION #<FORM-TRACKING-STREAM for "file /tmp/930680F198984DD13F52082FA89DA81F-366519187.mac" {10060F87B3}> 0)
8: (MREAD-SYNERR ~A is not an infix operator #<unavailable &REST argument>)
9: ((LAMBDA (ORIG &REST ARGS) :IN "/home/app/.local/share/maxima-jupyter/local-projects/maxima-jupyter/src/overrides.lisp") #<FUNCTION MREAD-SYNERR {52A4FC6B}> ~A is not an infix operator $ERF)
10: ((LAMBDA (&REST MAXIMA-JUPYTER::ARGS) :IN "/tmp/930680F198984DD13F52082FA89DA81F-3906979965.mac") ~A is not an infix operator $ERF)
11: (LED-CALL %ERF ($ANY . ?))
12: (PARSE $ANY 0)
13: (MREAD-RAW #<FORM-TRACKING-STREAM for "file /tmp/930680F198984DD13F52082FA89DA81F-366519187.mac" {10060F87B3}> NIL)
14: (MREAD-RAW #<FORM-TRACKING-STREAM for "file /tmp/930680F198984DD13F52082FA89DA81F-366519187.mac" {10060F87B3}>)
15: (MAXIMA-JUPYTER::MY-MREAD #<FORM-TRACKING-STREAM for "file /tmp/930680F198984DD13F52082FA89DA81F-366519187.mac" {10060F87B3}>)
16: ((:METHOD JUPYTER:EVALUATE-FORM (MAXIMA-JUPYTER::KERNEL T T T)) #<KERNEL {10058A4E83}> #<FORM-TRACKING-STREAM for "file /tmp/930680F198984DD13F52082FA89DA81F-366519187.mac" {10060F87B3}> CELL:366519187.MAC.NEWEST NIL 1 0)
17: (JUPYTER/COMMON-LISP::REPL ?? erf CELL:366519187.MAC.NEWEST NIL)
18: ((:METHOD JUPYTER:EVALUATE-CODE (JUPYTER/COMMON-LISP:KERNEL T)) #<unused argument> ?? erf CELL:366519187.MAC.NEWEST NIL)
19: ((:METHOD JUPYTER:EVALUATE-CODE :AROUND (MAXIMA-JUPYTER::KERNEL T)) #<KERNEL {10058A4E83}> ?? erf CELL:366519187.MAC.NEWEST NIL)
20: (JUPYTER::HANDLE-EXECUTE-REQUEST)
21: (JUPYTER::RUN-SHELL #<KERNEL {10058A4E83}>)
22: ((LAMBDA NIL :IN BORDEAUX-THREADS::BINDING-DEFAULT-SPECIALS))
23: ((FLET SB-UNIX::BODY :IN SB-THREAD::RUN))
24: ((FLET "WITHOUT-INTERRUPTS-BODY-10" :IN SB-THREAD::RUN))
25: ((FLET SB-UNIX::BODY :IN SB-THREAD::RUN))
26: ((FLET "WITHOUT-INTERRUPTS-BODY-3" :IN SB-THREAD::RUN))
27: (SB-THREAD::RUN)
28: ("foreign function: call_into_lisp")
29: ("foreign function: funcall1")

These are my jupyter and maxima versions:

[app@5334effd62eb examples]$ jupyter --version
Selected Jupyter core packages...
IPython          : 7.30.0
ipykernel        : 6.5.1
ipywidgets       : 7.6.5
jupyter_client   : 7.1.0
jupyter_core     : 4.9.1
jupyter_server   : 1.12.1
jupyterlab       : 3.2.4
nbclient         : 0.5.4
nbconvert        : 6.1.0
nbformat         : 5.1.3
notebook         : 6.4.4
qtconsole        : not installed
traitlets        : 5.1.0
[app@5334effd62eb examples]$ maxima
Maxima 5.45.1 https://maxima.sourceforge.io
using Lisp SBCL 2.1.9
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1)
@yitzchak
Copy link
Contributor

yitzchak commented Dec 2, 2021

This is probably because I had to stop using dbm-read to support the debugger. @robert-dodier I'll do some digging to figure out if it fixable.

@luisbarrancos
Copy link

luisbarrancos commented Jul 26, 2022

@yitzchak any extra information about this issue? I ran into it as well, with a somewhat recent version.

SIMPLE-STREAM-ERROR: #<SB-INT:FORM-TRACKING-STREAM for "file /tmp/3CC8000FCDC140F480FB26B7A3712409-2822582361.mac" {1005A4A5D3}> is not positionable

0: (SB-IMPL::TRACKING-STREAM-MISC #<FORM-TRACKING-STREAM for "file /tmp/3CC8000FCDC140F480FB26B7A3712409-2822582361.mac" {1005A4A5D3}> FILE-POSITION 0 NIL)
1: (FILE-POSITION #<FORM-TRACKING-STREAM for "file /tmp/3CC8000FCDC140F480FB26B7A3712409-2822582361.mac" {1005A4A5D3}> 0)
2: (MREAD-SYNERR ~A is not an infix operator #<unavailable &REST argument>)
3: ((LAMBDA (ORIG &REST ARGS) :IN "/home/tux2/.local/share/maxima-jupyter/local-projects/maxima-jupyter/src/overrides.lisp") #<FUNCTION MREAD-SYNERR {5214FECB}> ~A is not an infix operator $ERF)
4: ((LAMBDA (&REST MAXIMA-JUPYTER::ARGS) :IN "/tmp/3CC8000FCDC140F480FB26B7A3712409-898870744.mac") ~A is not an infix operator $ERF)
5: (LED-CALL %ERF ($ANY . ?))
6: (PARSE $ANY 0)
7: (MREAD-RAW #<FORM-TRACKING-STREAM for "file /tmp/3CC8000FCDC140F480FB26B7A3712409-2822582361.mac" {1005A4A5D3}> NIL)
8: (MREAD-RAW #<FORM-TRACKING-STREAM for "file /tmp/3CC8000FCDC140F480FB26B7A3712409-2822582361.mac" {1005A4A5D3}>)
9: (MAXIMA-JUPYTER::MY-MREAD #<FORM-TRACKING-STREAM for "file /tmp/3CC8000FCDC140F480FB26B7A3712409-2822582361.mac" {1005A4A5D3}>)
10: ((:METHOD JUPYTER:EVALUATE-FORM (MAXIMA-JUPYTER::KERNEL T T T)) #<KERNEL {10046212E3}> #<FORM-TRACKING-STREAM for "file /tmp/3CC8000FCDC140F480FB26B7A3712409-2822582361.mac" {1005A4A5D3}> CELL:2822582361.MAC.NEWEST NIL 1 0)
11: (JUPYTER/COMMON-LISP::REPL ?? erf ; CELL:2822582361.MAC.NEWEST NIL)
12: ((:METHOD JUPYTER:EVALUATE-CODE (JUPYTER/COMMON-LISP:KERNEL T)) #<unused argument> ?? erf ; CELL:2822582361.MAC.NEWEST NIL)
13: ((:METHOD JUPYTER:EVALUATE-CODE :AROUND (MAXIMA-JUPYTER::KERNEL T)) #<KERNEL {10046212E3}> ?? erf ; CELL:2822582361.MAC.NEWEST NIL)
14: (JUPYTER::HANDLE-EXECUTE-REQUEST)
15: (JUPYTER::RUN-SHELL #<KERNEL {10046212E3}>)
16: ((LAMBDA NIL :IN BORDEAUX-THREADS::BINDING-DEFAULT-SPECIALS))
17: ((FLET SB-UNIX::BODY :IN SB-THREAD::NEW-LISP-THREAD-TRAMPOLINE))
18: ((FLET "WITHOUT-INTERRUPTS-BODY-4" :IN SB-THREAD::NEW-LISP-THREAD-TRAMPOLINE))
19: ((FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::NEW-LISP-THREAD-TRAMPOLINE))
20: ((FLET "WITHOUT-INTERRUPTS-BODY-1" :IN SB-THREAD::CALL-WITH-MUTEX))
21: (SB-THREAD::CALL-WITH-MUTEX #<CLOSURE (FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::NEW-LISP-THREAD-TRAMPOLINE) {7F1A8B7F6D7B}> #<MUTEX "thread result lock" owner: #<SB-THREAD:THREAD "SHELL Thread" RUNNING {1005B8C1B3}>> NIL T NIL)
22: (SB-THREAD::NEW-LISP-THREAD-TRAMPOLINE #<THREAD "SHELL Thread" RUNNING {1005B8C1B3}> NIL #<CLOSURE (LAMBDA NIL :IN BORDEAUX-THREADS::BINDING-DEFAULT-SPECIALS) {1005B8C15B}> NIL)
23: ("foreign function: call_into_lisp")
24: ("foreign function: new_thread_trampoline")

with the following packages, SBCL 2.0.1-Debian (Ubuntu 20.04LTS), Maxima 5.46.0, Python 3.8.10, and Jupyter

jupyter core     : 4.7.1
jupyter-notebook : 6.4.3
qtconsole        : not installed
ipython          : 7.27.0
ipykernel        : 6.4.1
jupyter client   : 7.0.2
jupyter lab      : 3.1.11
nbconvert        : 6.1.0
ipywidgets       : 7.6.4
nbformat         : 5.1.3
traitlets        : 5.1.0

@robert-dodier
Copy link
Owner

Thanks for the bug reports. Just to be clear, ?? and erf have to be separated, otherwise it's one token. The error triggered by ?? erf is actually " is not an infix operator", where is probably erf, and the Lisp error about "stream not positionable" is occurring because Maxima is trying to get line number information for the syntax error message. (Yes, the whole business about seeking back to the start of the file and then counting lines is terrible.)

? and ?? are handled by DBM-READ which calls MREAD, but, I think, maxima-jupyter is calling MREAD or MREAD-RAW directly. We might have to reimplement ? and ?? somehow, if we can't call DBM-READ.

Hope this clarifies the situation somewhat. Thank you for your interest in maxima-jupyter.

@luisbarrancos
Copy link

@robert-dodier thank you for the clarification, and i'll take the chance to thank you for your work in maxima-jupyter. It's been an invaluable tool.

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