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

Loading "named-readtables" with MKCL gives error #13

Closed
m-e-leypold opened this issue Jul 16, 2023 · 6 comments
Closed

Loading "named-readtables" with MKCL gives error #13

m-e-leypold opened this issue Jul 16, 2023 · 6 comments
Assignees
Labels

Comments

@m-e-leypold
Copy link

m-e-leypold commented Jul 16, 2023

Note: The code on the named readtables side looks completely allright. I'm posting this issue here because I suspect this might an mkcl bug.

When trying to load https://github.com/melisgl/named-readtables via quicklisp in MKCL (in the SLIME REPL) I get the following:

CL-USER> (asdf:load-system "named-readtables")
;;; Warning: in file /user/home/mel/my/quicklisp/dists/quicklisp/software/named-readtables-20220331-git/src/named-readtables.lisp, end position 14949,
;;;     and form: (DEFINE-API MERGE-READTABLES-INTO (RESULT-READTABLE &REST NAMED-READTABLES) ...)
;;;   Too many arguments passed to SET-MACRO-CHARACTER

and then in a slime backtrace buffer:

COMPILE-FILE-ERROR while compiling
   #<ASDF/INTERFACE::NAMED-READTABLES-SOURCE-FILE "named-readtables" "named-readtables">
   [Condition of type UIOP/LISP-BUILD:COMPILE-FILE-ERROR]

Restarts:
 0: [RETRY] Retry compiling #<ASDF/INTERFACE::NAMED-READTABLES-SOURCE-FILE "named-readtables" "named-readtables">.
 1: [ACCEPT] Continue, treating compiling #<ASDF/INTERFACE::NAMED-READTABLES-SOURCE-FILE "named-readtables" "named-readtables"> as having been successful.
 2: [RETRY] Retry ASDF operation.
 3: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the configuration.
 4: [RETRY] Retry ASDF operation.
 5: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the configuration.
 --more--

Backtrace:
  0: LAMBDA, closure generated from SWANK-DEBUGGER-HOOK
  1: BYTECODE [Evaluation of: (ASDF/OPERATE:LOAD-SYSTEM "named-readtables")]
  2: LAMBDA, closure generated from LAMBDA
  3: TRACK-PACKAGE
  4: LAMBDA, closure generated from LAMBDA
  5: LAMBDA, closure generated from REPL-EVAL

I am a bit lost what the problem is, since also I seem to be able to load the referenced file juts fine:

CL-USER> (load "/user/home/mel/my/quicklisp/dists/quicklisp/software/named-readtables-20220331-git/src/named-readtables.lisp")
#P"/user/home/mel/my/quicklisp/dists/quicklisp/software/named-readtables-20220331-git/src/named-readtables.lisp"
CL-USER> 

The two occurrences of SET-MACRO-CHARACTER in the file also look totally fine and have 4 arguments which should be fine according to the CLHS.

Admittedly this issue is a bit of a fishing expedition. I'm a bit lost how to debug this on the MKCL side. Perhaps you can give me some pointers?

The MKCL version I'm using:

$ mkcl --version
MKCL 1.1.11.187-19222c1

If I start with an empty compilation cache I get some additional warnings, which as precursors might be of interest. I'll document those in an extra reply-

@m-e-leypold
Copy link
Author

Starting with an empty compilation cache:

CL-USER> (asdf:load-system "named-readtables")
;;; Warning: 
  EDITOR-HINTS.NAMED-READTABLES has not been ported to MKCL. We fall back to a
  portable implementation of readtable iterators. This implementation has to
  grovel through all available characters. On Unicode-aware implementations
  this may come with some costs.
;;; Warning: Lisp compilation had style-warnings while compiling
   #<ASDF/INTERFACE::NAMED-READTABLES-SOURCE-FILE "named-readtables" "cruft">
;;; Warning: in file /user/home/mel/my/quicklisp/dists/quicklisp/software/named-readtables-20220331-git/src/named-readtables.lisp, end position 14949,
;;;     and form: (DEFINE-API MERGE-READTABLES-INTO (RESULT-READTABLE &REST NAMED-READTABLES) ...)
;;;   Too many arguments passed to SET-MACRO-CHARACTER

@m-e-leypold
Copy link
Author

The referenced occurrence of set-macro-character:
(set-macro-character char reader-fn non-terminating-p to)

@jcbeaudoin
Copy link
Owner

Thank you for the report. I'll investigate some more later this evening...

@jcbeaudoin jcbeaudoin self-assigned this Jul 17, 2023
@jcbeaudoin jcbeaudoin added the bug label Jul 17, 2023
@jcbeaudoin
Copy link
Owner

Found a bad proclaim in cmp/sysfun.lsp. Most probably the source of the bug.
I pushed a fix on master HEAD. Could you try it?

@m-e-leypold
Copy link
Author

Will do. If I don't succeed in the next ~30 minutes, I'll only be able to look at it tomorrow in the evening.

@m-e-leypold
Copy link
Author

Great, it works now! Thank you very much!
:-)

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

No branches or pull requests

2 participants