Open digikar99 opened 3 years ago
The same error as for Allegro occurs in LispWorks. It is caused by the symbol MATCH not recognized as a macro. In sbcl.lisp, th epackage cl-envrioenments-cltl uses the apckage OPTIMA, wher it gets the symbol MATCH. In allegro.lispa nd lispworks.lisp it doesn't. Either qualify the symbol optimia:match, or use the package like in sbcl.lisp
Should be fixed in the latest commit.
It does load now; but a few things:
1.
This should perhaps also include (See point 3.):declaration-information
.
define-declaration
could also declare arg-var
as ignorable
(in-package :cl-environments.cltl2)
(defmacro var-info (var &environment env)
(print (multiple-value-list (variable-information var env)))
nil)
(let ((a "hello"))
(declare (type string a))
(var-info a)
a)
On SBCL, the printed information is (:LEXICAL T ((TYPE . STRING)))
while on ACL, it is (:LEXICAL T ((TYPE (ARRAY CHARACTER (*)))))
; so perhaps, the output of sys:variable-information
needs to be processed to produce the required alist instead of the list; similar seems to be the case with sys:function-information
and sys:declaration-information
Regarding point 2. I suppose so. I will add it. As for point 3. CLTL2 allows the implementation to store a different type specifier in the environment, from the specifier in the type declaration.
From the documentation for variable-information
at https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node102.html:
The value is a type specifier associated with the variable by a type declaration or an abbreviated declaration such as (fixnum variable). If no explicit association exists, either by proclaim or declare, then the type specifier is t. It is permissible for implementations to use a type specifier that is equivalent to or a supertype of the one appearing in the original declaration. If the value is t, the pair might be omitted.
I don't know whether in this case the type returned by variable-information
is a supertype of string
or not. However I'd prefer not to be modifying the results returned by the native *-information
functions, where they are provided by the implementation, other than to add support for custom declarations. To solve this issue I'd either have to come up with some canonical representation for types, or add the full code walker to every implementation, including those which support CLTL2, in order to guarantee that the type returned is identical to the declared type. Neither solution is ideal and it's beyond the scope of this project.
Ah, I wanted to refer to it being the list ((TYPE (ARRAY CHARACTER (*))))
on ACL and not an alist ((TYPE ARRAY CHARACTER (*)))
like ((TYPE . STRING))
on SBCL
Oh, in that case, that's something I can do. I will probably have to make the change for all standard declarations, dynamic-extent
, etc.
Not sure whether this needs a separate issue. Lots of tests fail on AllegroCL (alisp):
Did 142 checks.
Pass: 55 (38%)
Skip: 0 ( 0%)
Fail: 87 (61%)
I believe AllegroCL's implementation is very different as evidenced by the (broken) special casing in trivial-cltl2.
I'm having this problem again with Allegro CL 11.0
International Allegro CL Enterprise Edition 11.0 [64-bit macOS (Apple Silicon)] Copyright (C) 1985-2023, Franz Inc., Lafayette, CA, USA. All Rights Reserved.
This development copy of Allegro CL is licensed to: [TC22861]
Note: Allegro CL will expire in 70 days, on June 30, 2024. ; Loading /Users/hunter/quicklisp/setup.lisp ; Fast loading ; /Applications/AllegroCL64.app/Contents/Resources/code/asdf.001 ;;; Installing asdf patch, version 1. ; Autoloading for class synonym-stream: ; Fast loading from bundle code/streamc.fasl. ; Fast loading from bundle code/efft-utf-8s-base.fasl. ; Fast loading from bundle code/efft-utf8-base.fasl. ; Fast loading from bundle code/efft-void.fasl. ; Fast loading from bundle code/efft-latin1-base.fasl. ; Autoloading for package "excl.osi": ; Fast loading ; /Applications/AllegroCL64.app/Contents/Resources/code/osi.fasl ; Fast loading from bundle code/fileutil.fasl. ; Fast loading from bundle code/acldns.fasl. ; Fast loading from bundle code/iodefs.fasl. ; Fast loading from bundle code/iordefs.fasl. ; Fast loading from bundle code/efmacs.fasl. ;; Optimization settings: safety 1, space 1, speed 1, debug 2, ;; compilation-speed 1. ;; For a complete description of all compiler switches given the ;; current optimization settings evaluate (explain-compiler-settings). ;;--- ;; Current reader case mode: :case-sensitive-lower cl-user(1): (ql:quickload "cl-environments") To load "cl-environments": Load 1 ASDF system: cl-environments ; Loading "cl-environments" ; While file-compiling #'match-state in
; starting at file character position 1226: Error: Attempt to take the value of the unbound variable `g!test'. [condition type: unbound-variable] Problem detected when processing (let-if ((start (second states) ...) (body (cddr states) ...)) ...) inside <...> inside (labels ...) inside (let ...) inside (progn (let ((next (intern #)) (from-state (intern #))) ...)) inside <...> inside (let nil ...) inside (let ...) inside (let nil ...) inside (block match-state ...) inside (comp::named-function-1 ...) inside (excl:compiler-let ...) inside (the excl::known-function ...) inside (excl:named-function match-state ...) inside (let* ...)
Restart actions (select using :continue): 0: Try evaluating g!test again. 1: Set the symbol-value of g!test and use its value. 2: Use a value without setting g!test. 3: retry the compilation of /Users/hunter/quicklisp/dists/quicklisp/software/cl-environments-20211020-git/src/common/macro-util.lisp 4: continue compiling /Users/hunter/quicklisp/dists/quicklisp/software/cl-environments-20211020-git/src/common/macro-util.lisp but generate no output file 5: Retry compiling
6: Continue, treating compiling
having been successful.
7: Retry ASDF operation. 8: Retry ASDF operation after resetting the configuration. 9: Give up on "cl-environments" 10: Register local projects and try again. 11: Return to Top Level (an "abort" restart). 12: Abort entirely from this (lisp) process.
[changing package from "common-lisp-user" to "cl-environments.util"] [1] cl-environments.util(2):
It's not about finding match, though:
(describe 'match) match is a tenured symbol. It is unbound. It is external in the optima package and accessible in the cl-environments.util, common-lisp-user, and optima.extra packages. Its function binding is #<macro match @ #x301088f02> which macro takes arguments (arg &body clauses) ...
It seems to be a problem with the defmacro!
macro from let-over-lambda. I will take a look at it.
Depending on if I'm using mlisp or alisp, the errors are different; for alisp, it is:
While on mlisp, the error is: