-
-
Notifications
You must be signed in to change notification settings - Fork 27
Add :IMPORT-FROM option to DEFPACKAGE #2335
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
Conversation
|
I forgot to include the dribble files, here they are from another build that failed in the same way: loadups.zip |
|
Same. |
|
I didn't change any code except to add the |
|
The previous LCOM was made with compile-file, according to the comments in it, as was the version in CLTL2. So, i'm not sure if that's COMPILE-FILE or FAKE-COMPILE-FILE... since it's an LCOM. |
|
Doesn't it have to be FAKE-COMPILE-FILE? It has a lot of commonlisp FUNCTIONS etc.
… On Oct 30, 2025, at 11:33 AM, Nick Briggs ***@***.***> wrote:
nbriggs
left a comment
(Interlisp/medley#2335)
<#2335 (comment)>
The previous LCOM was made with compile-file, according to the comments in it, as was the version in CLTL2. So, i'm not sure if that's COMPILE-FILE or FAKE-COMPILE-FILE... since it's an LCOM.
—
Reply to this email directly, view it on GitHub <#2335 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AQSTUJP2ZIXP6T4Q7RAHD5D32JKX7AVCNFSM6AAAAACKUGUZBSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTINRZGQ4TQMJWG4>.
You are receiving this because you are subscribed to this thread.
|
|
Yes - if you FAKE-COMPILE-FILE it you can do a loadup successfully. |
Change the FILETYPE to be :FAKE-COMPILE-FILE (per #2336)
|
I can do a loadup with the revised LLPACKAGE.LCOM. I don't have anything to test the :IMPORT-FROM functionality. |
|
man cl:import import adds symbol or symbols to the internals of package, checking for name conflicts with existing symbols either present in package or accessible to it. Once the symbols have been imported, they may be referenced in the importing package without the use of a package prefix when using the Lisp reader. There isn't anything about referencing an imported symbol using the internal symbol package prefix notation... only if you are in-package("PKG") that you can reference the imported symbol without any package prefix. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this PR needs to wait for it, but we should try to make the apperance of internal package prefix notation in our pretty printed source code. It's especially egregious to have :: double colon references to symbols which are internal lexically scoped variables.
I'm not sure where to put the fix to eliminate those uses.
|
@masinter - the existing DEFPACKAGE code seems to have carefully used IL: symbols for all the temporary variables, unless they happened to already be symbols in the LISP: package. There are a few places in other functions that use XCL:: temporaries, and a few that really are internal symbols of the XCL package. I'm not sure what the right answer is given that they need to be printed with respect to the define-file-info reader environment so that they can be correctly read back. |
If it is thought to be appropriate, I can redo this using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pamaroso apparently the new defpackage in this PR doesn't import the symbol named after all.
If I supply symbols it does:
(defpackage "PKG2" (:USE "LISP" "XCL") (:import-from "IL" il:createw))
followed by (in-package "PKG2") and (createw) will invoke IL:CREATEW.
the DEFPACKAGE arguments for :IMPORT-FROM are defined to be symbols and not strings.
from man cl:defpackage
(:import-from package-name {symbol-name}*)*
:import-from
The symbols named by the argument symbol-names are found in the package named by package-name and they are imported into the package being defined. In no case are symbols created in any package other than the one being define
|
The CLHS entry for |
|
i remember now that package initialization and specifically the code in LLPACKAGE needs some special manipulation and can't easily be modified because the package system isn't really usablle until the foundation packages (IL, LISP, XCL, XCL-USER) are set up. |
|
I did another PR #2350 with a fix: pass PACKAGE as the second argument to IMPORT so it affects the package defined by the defpackage rather than PACKAGE. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMPORT PACKAGE param fixed
|
Fixed error of missing PACKAGE argument in call to IMPORT.
(IL:DEFPACKAGE "XCL-USER" (:IMPORT-FROM "IL" "IT"))
|




This resolves #2334