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

Add augmentation methods for SBCL client #26

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

paulapatience
Copy link
Member

No description provided.

Variables proclaimed SB-EXT:GLOBAL were not being looked up outside of
the lexical environment, i.e., via SB-INT:INFO. SBCL actually signals an
error when lexically binding an SB-EXT:GLOBAL variable, so I do not know
how it can be possible to look one up in the lexical environment, but
that is what SB-CLTL2:VARIABLE-INFORMATION does.

The type, always-bound and deprecated information was not being filled
in for global variables.

Finally, the always-bound-mixin and deprecated-mixin classes were being
mixed into some description classes that cannot ever be always-bound or
deprecated.

The SBCL manual states that the always-bound declaration is valid only
as a global proclamation [1], so local variables cannot be thus
declared. Although it does not mention it explicitly [2], deprecated
declarations must also be global proclamations (SBCL signals warnings
for both otherwise).

Some experimentation on my part showed that local special variables do
not carry over the always-bound and deprecated information from their
global counterparts.

Constant variables and global symbol macros cannot be always-bound
either, as demonstrated by the following code:

  (defconstant +%test-constant+ nil)
  (declaim (sb-ext:always-bound +%test-constant+))

  (define-symbol-macro +%test-symbol-macro+ nil)
  (declaim (sb-ext:always-bound +%test-symbol-macro+))

This commit looks up SB-EXT:GLOBAL variables outside of the lexical
environment, fill in the type, always-bound and deprecated information
in DESCRIBE-VARIABLE where missing, removes ALWAYS-BOUND-MIXIN from the
superclasses of all variable description classes except
GLOBAL-SPECIAL-VARIABLE-DESCRIPTION and GLOBAL-VARIABLE-DESCRIPTION, and
removes DEPRECATED-MIXIN from the superclasses of
LEXICAL-VARIABLE-DESCRIPTION, LOCAL-SPECIAL-VARIABLE-DESCRIPTION and
LOCAL-SYMBOL-MACRO-DESCRIPTION.

[1]: http://www.sbcl.org/manual/#Global-and-Always_002dBound-variables
[2]: http://www.sbcl.org/manual/#Deprecation-Declaration
Bring it in line with SB-CLTL2:FUNCTION-INFORMATION (which might have
been updated since the last time DESCRIBE-FUNCTION was updated).

Added compiler-macro and deprecated information where applicable, and
cleaned up the global ftype from any SBCL-specific representation by
calling SB-KERNEL:TYPE-SPECIFIER on it. Removed DEPRECATED-MIXIN from
superclasses of LOCAL-FUNCTION-DESCRIPTION and
LOCAL-MACRO-DESCRIPTION (see previous commit for explanation).
Also overhaul the test suite to allow for the newly added augmentation
tests.
@paulapatience paulapatience marked this pull request as draft January 6, 2024 16:39
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

Successfully merging this pull request may close these issues.

1 participant