Genera: Unlocking a Package
Asked Answered
P

1

6

There isn't a Genera topic on stackoverflow, but I thought I'd take the chance that one of the (probably) 5 people in the world using it might be here; no harm in trying.

I've run into the situation where a few of the systems I'm working with use pretty printing, which is not implemented on Genera. I've managed to work around the problem in my own system by using the predecessor of pretty printing, XP. Looking at the code in xp-code.lisp and comparing it to that in CCL, it's clear where CCL got its pretty printing functions from.

One solution, now proving inadequate, is to have a top-level eval that does an (xp::install :package my-package) and resume from the redefinition warnings. The problem is that when one of the third-party systems is compiled, they too complain about pretty printing features that are not implemented, so I'd have to install XP in each of these other packages that want pretty printing.

What really needs to happen is for XP to be installed in the common-lisp package, because all of these other systems are going to :use :cl and expect to have a fully functional pretty printing system.

That's not so easy though; the CL package is locked and each XP symbol requires multiple confirms, and a type 'yes', to get it into the CL package. The documentation for External-only Packages and Locking suggests that:

To set up an external-only package, it can be temporarily unlocked and then the desired set of symbols interned in it

but no where does it say how to unlock a package, and the Document Examiner isn't turning up much.

I also have to stop and wonder if I'm barking up the wrong tree. XP was written with Genera in mind, and there are conditionalisations in the code for the platform. It shouldn't be so hard to install using the install function; and I wonder if I'm missing something obvious.

Does anyone out there know how to unlock the CL package, or the proper way install XP in Genera? The included instructions for XP appear to be out of date.

Poulos answered 21/9, 2021 at 7:33 Comment(0)
A
0

I figured it out:

(zl:setf (si:pkg-locked (find-package :cl)) nil)

Then you're free to do as you please with the CL package. Note that setf without a package qualifier might be cl:setf, which is completely different from zl:setf and won't work.

Across answered 22/2, 2022 at 10:55 Comment(1)
Wow. That was some serious sleuthing. I won't be able to try this for a while, as I'm not using Genera at the moment, but will mark it as the answer. Thanks.Poulos

© 2022 - 2024 — McMap. All rights reserved.