Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Whip me. Beat me. Make me maintain AIX. -- Stephan Zielinski


devel / comp.lang.lisp / make-package without :use

SubjectAuthor
* make-package without :usePhil Roc
+- Re: make-package without :useHelmut Eller
+- Re: make-package without :useKaz Kylheku
`- Re: make-package without :useZyni Moë

1
make-package without :use

<9b0c88b2-57fa-45a3-8bde-5b3fd1eb5007n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17103&group=comp.lang.lisp#17103

  copy link   Newsgroups: comp.lang.lisp
X-Received: by 2002:a05:6214:5008:b0:45b:82:6ef with SMTP id jo8-20020a056214500800b0045b008206efmr18696859qvb.87.1652765827328;
Mon, 16 May 2022 22:37:07 -0700 (PDT)
X-Received: by 2002:a05:6830:34a5:b0:606:428d:71eb with SMTP id
c37-20020a05683034a500b00606428d71ebmr7230742otu.363.1652765827073; Mon, 16
May 2022 22:37:07 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.lisp
Date: Mon, 16 May 2022 22:37:06 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=78.196.108.109; posting-account=m91DWAoAAAAsWayWDGElqy5F3VzzVX1N
NNTP-Posting-Host: 78.196.108.109
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9b0c88b2-57fa-45a3-8bde-5b3fd1eb5007n@googlegroups.com>
Subject: make-package without :use
From: phiroc@free.fr (Phil Roc)
Injection-Date: Tue, 17 May 2022 05:37:07 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1830
 by: Phil Roc - Tue, 17 May 2022 05:37 UTC

Good morning,
If I run the following code, I get error messaging stating that
that defun, format, ... are not declared in package BOB, ...

----------
(make-package :bob)
;;:use '("CL"))
(make-package :jane)
;;:use '("CL"))

(in-package "BOB")
(defun foo () (format t "In ~A's, running foo...~%" *package*))
(foo)
(in-package "JANE")
(defun foo () (format t "In ~A's, running foo...~%" *package*))
(foo)
-----------

This version of the code doesn't work either:

----------
(make-package :bob)
;;:use '("CL"))
(make-package :jane)
;;:use '("CL"))

(in-package "BOB")
(defun foo () (format t "In ~A's, running foo...~%" *package*))
(foo)
(in-package "JANE")
(defun foo () (format t "In ~A's, running foo...~%" *package*))
(foo)
-------------

Are there any other solutions besides uncommenting (:use '("CL")')?

Re: make-package without :use

<m21qwsfugx.fsf@gmail.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17104&group=comp.lang.lisp#17104

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!aioe.org!bw3XQaVALXgR+63+jBH2Vw.user.46.165.242.91.POSTED!not-for-mail
From: eller.helmut@gmail.com (Helmut Eller)
Newsgroups: comp.lang.lisp
Subject: Re: make-package without :use
Date: Tue, 17 May 2022 10:12:46 +0200
Organization: Aioe.org NNTP Server
Message-ID: <m21qwsfugx.fsf@gmail.com>
References: <9b0c88b2-57fa-45a3-8bde-5b3fd1eb5007n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: gioia.aioe.org; logging-data="949"; posting-host="bw3XQaVALXgR+63+jBH2Vw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
Cancel-Lock: sha1:NkgQkriQ7kzWBXLxUzcZtRgrcpk=
X-Notice: Filtered by postfilter v. 0.9.2
 by: Helmut Eller - Tue, 17 May 2022 08:12 UTC

> Are there any other solutions besides uncommenting (:use '("CL")')?

You could write CL:DEFUN instead of DEFUN. If you are in package BOB
and the Lisp system reads DEFUN, then it creates a fresh symbol in the
BOB package, i.e., BOB::DEFUN which is different from CL:DEFUN.

With the :USE CL argument the system first searches in the CL package
for names before deciding to create fresh symbols.

Helmut

Re: make-package without :use

<20220517005956.339@kylheku.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17105&group=comp.lang.lisp#17105

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!aioe.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: 480-992-1380@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.lisp
Subject: Re: make-package without :use
Date: Tue, 17 May 2022 08:13:38 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <20220517005956.339@kylheku.com>
References: <9b0c88b2-57fa-45a3-8bde-5b3fd1eb5007n@googlegroups.com>
Injection-Date: Tue, 17 May 2022 08:13:38 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="5b280366f2fd2d92cb2d833d0458d468";
logging-data="32083"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19drNnfIBA6K4F3/gnz6h3p5O5elXiBGTQ="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:+S62ZKLMn3zbTWWKIWgDvXOllqI=
 by: Kaz Kylheku - Tue, 17 May 2022 08:13 UTC

On 2022-05-17, Phil Roc <phiroc@free.fr> wrote:
> Are there any other solutions besides uncommenting (:use '("CL")')?

The "use" mechanism creates a window from one package to another;
symbols which are exported by the used package are visible in the
using package. They are not actually present in the using package;
it's only a visibility trick.

The only alternative to visibility via use is to actually make
the desired symbols present in your package by importing them
individually. See the functions import and shadowing-import.

--
n TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal

Re: make-package without :use

<t5vnk1$kbj$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17106&group=comp.lang.lisp#17106

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: no_email@invalid.invalid (Zyni Moë)
Newsgroups: comp.lang.lisp
Subject: Re: make-package without :use
Date: Tue, 17 May 2022 08:50:09 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <t5vnk1$kbj$1@dont-email.me>
References: <9b0c88b2-57fa-45a3-8bde-5b3fd1eb5007n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 17 May 2022 08:50:09 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="12fd3b50d0089e5bd6e265965d468018";
logging-data="20851"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/s1/fd7ieyZwVTMJigbdvI5/NMxBzlNG0="
User-Agent: NewsTap/5.5 (iPad)
Cancel-Lock: sha1:rNpfSCz1q/Tiw9l+bUbageFNLo8=
sha1:z8XxhBhtnomFbYFtn8scOnY8j0c=
 by: Zyni Moë - Tue, 17 May 2022 08:50 UTC

Phil Roc <phiroc@free.fr> wrote:
> Good morning,
> If I run the following code, I get error messaging stating that
> that defun, format, ... are not declared in package BOB, ...
> [...]
>
> Are there any other solutions besides uncommenting (:use '("CL")')?
>

To be precise you may or may not get such errors since the default for :use
is implementation-defined: your code might 'work' on some implementations
but not on others.

You could make it 'work' on more by:

(make-package :foo)
(use-package '(:cl) ':foo)

This still leaves the package use list only partly specified (it may
include other packages than the CL package). If you want it
fully-specified you must specify it.

However none of this will make your code actually work: make-package &
use-package are functions so the packages you are making will not exist at
compile time so your code cannot be compiled. That is why you should use
defpackage.

--
the small snake

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor