Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Swap read error. You lose your mind.


devel / comp.lang.lisp / Three ways to make-package

SubjectAuthor
* Three ways to make-packagePhil Roc
+* Re: Three ways to make-packageMadhu
|`* Re: Three ways to make-packageStefan Monnier
| +* Re: Three ways to make-packageZyni Moë
| |`* Re: Three ways to make-packageKaz Kylheku
| | `- Re: Three ways to make-packageZyni Moë
| `- Re: Three ways to make-packageMadhu
`- Re: Three ways to make-packageKaz Kylheku

1
Three ways to make-package

<7b5490b3-f133-416c-bf07-2a247cfc5f34n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
X-Received: by 2002:a05:622a:3cf:b0:2f3:ec70:4e72 with SMTP id k15-20020a05622a03cf00b002f3ec704e72mr15033258qtx.61.1652704077637;
Mon, 16 May 2022 05:27:57 -0700 (PDT)
X-Received: by 2002:a05:6870:96a3:b0:f1:af74:a858 with SMTP id
o35-20020a05687096a300b000f1af74a858mr863315oaq.229.1652704073324; Mon, 16
May 2022 05:27:53 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.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 05:27:51 -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: <7b5490b3-f133-416c-bf07-2a247cfc5f34n@googlegroups.com>
Subject: Three ways to make-package
From: phiroc@free.fr (Phil Roc)
Injection-Date: Mon, 16 May 2022 12:27:57 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1194
 by: Phil Roc - Mon, 16 May 2022 12:27 UTC

Hello,
the (make-package ...) form tolerates three syntaxes:

(make-package "bob")
(make-package 'bob)
(make-package :bob)

but not
(make-package bob)

[although (defpackage bob) works]

Why is that?

Thanks.

Re: Three ways to make-package

<m3mtfhy6ww.fsf@leonis4.robolove.meer.net>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: enometh@meer.net (Madhu)
Newsgroups: comp.lang.lisp
Subject: Re: Three ways to make-package
Date: Mon, 16 May 2022 18:24:23 +0530
Organization: Motzarella
Lines: 41
Message-ID: <m3mtfhy6ww.fsf@leonis4.robolove.meer.net>
References: <7b5490b3-f133-416c-bf07-2a247cfc5f34n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="6626f9dbb8ee735c817077858908c772";
logging-data="21802"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19S0MRtNKnzYZdo2ki4sFCyqAZruVSOM1g="
Cancel-Lock: sha1:G6ZDfcfV4BmI2CWyn8aCQ9H6xYE=
sha1:EZedQ60I39h1reuHTtLHrjMmHAA=
 by: Madhu - Mon, 16 May 2022 12:54 UTC

* Phil Roc <7b5490b3-f133-416c-bf07-2a247cfc5f34n@googlegroups.com> :
Wrote on Mon, 16 May 2022 05:27:51 -0700 (PDT):

>
> (make-package "bob")
> (make-package 'bob)
> (make-package :bob)
>
> but not
> (make-package bob)
>
> [although (defpackage bob) works]
>
> Why is that?

make-package is a function. functions always evaluate their arguments.
in the form (make-package bob) BOB is a symbol, and lisp tries to
evaluate it. the symbol BOB probably does not have a binding (either
lexically or globally) and so it fails

this would have worked:
(make-package 'bob)

or this:
(defparameter *bob* "BOB") ; don't use 'bob as it will become global
(make-package *bob*)

defpackage is a macro, and macros do not evaluate their args. the
argument is a string designator for a package name. the parameter BOB is
a strin designator for the string "BOB" so with (defpackage bob ...) you
are really reaching for (defpackage "BOB"). You should macroexpand the
defpackage form to see what it expands to.
Luckily Since neither defpackage[1] or make-package[2] are special
forms[3] your question has avoided a third complication.

[1] defpackage http://www.lispworks.com/documentation/lw71/CLHS/Body/m_defpkg.htm
[2] make-package http://www.lispworks.com/documentation/lw71/CLHS/Body/f_mk_pkg.htm
[3] special forms
http://www.lispworks.com/documentation/lw71/CLHS/Body/03_ababa.htm#clspecialops

Re: Three ways to make-package

<20220516082644.499@kylheku.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.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: Three ways to make-package
Date: Mon, 16 May 2022 15:30:37 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <20220516082644.499@kylheku.com>
References: <7b5490b3-f133-416c-bf07-2a247cfc5f34n@googlegroups.com>
Injection-Date: Mon, 16 May 2022 15:30:37 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="93358c737780a1d0e671d663dbb289ca";
logging-data="10142"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Eqw2gA6uv0DlAQzqpG5TFNqbyTx2vSu8="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:FBlTwuCZhYLPXK24PztEGdbNVB0=
 by: Kaz Kylheku - Mon, 16 May 2022 15:30 UTC

On 2022-05-16, Phil Roc <phiroc@free.fr> wrote:
> Hello,
> the (make-package ...) form tolerates three syntaxes:
>
> (make-package "bob")
> (make-package 'bob)
> (make-package :bob)
>
> but not
> (make-package bob)

Both defpackage and make-package take the package name in the
same format, as a "string designator" that can be a string or symbol.

Hint: this will work:

(let ((bob "bob"))
(make-package bob))

defpackage is a macro; make-package is a function.

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

Re: Three ways to make-package

<jwv4k1plbia.fsf-monnier+comp.lang.lisp@gnu.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: monnier@iro.umontreal.ca (Stefan Monnier)
Newsgroups: comp.lang.lisp
Subject: Re: Three ways to make-package
Date: Mon, 16 May 2022 11:54:43 -0400
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <jwv4k1plbia.fsf-monnier+comp.lang.lisp@gnu.org>
References: <7b5490b3-f133-416c-bf07-2a247cfc5f34n@googlegroups.com>
<m3mtfhy6ww.fsf@leonis4.robolove.meer.net>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="8c6de89055da9342c418661fa5b7d691";
logging-data="23288"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18NfjrQIfketym/hSk6BmeR"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
Cancel-Lock: sha1:ctVV0kk3urE25XBZL8TUSIHGEyc=
sha1:8kI6iobuKdMypzdq1FgfZt2aLFA=
 by: Stefan Monnier - Mon, 16 May 2022 15:54 UTC

> make-package is a function. functions always evaluate their arguments.

I'd insist here that it's actually not the functions that evaluate their
arguments, but the general language semantics. By the time the function
is involved, the arguments have already been evaluated.

Stefan

Re: Three ways to make-package

<t5u66j$896$1@dont-email.me>

  copy mid

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

  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: Three ways to make-package
Date: Mon, 16 May 2022 18:46:43 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <t5u66j$896$1@dont-email.me>
References: <7b5490b3-f133-416c-bf07-2a247cfc5f34n@googlegroups.com>
<m3mtfhy6ww.fsf@leonis4.robolove.meer.net>
<jwv4k1plbia.fsf-monnier+comp.lang.lisp@gnu.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 16 May 2022 18:46:43 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="5bef0cd8b3fd4737912949c7cd75c2d2";
logging-data="8486"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19SCFsg+AKRqMzbOJpPrr22vrtxmEhZOoA="
User-Agent: NewsTap/5.5 (iPad)
Cancel-Lock: sha1:SFvaEsYwnWCJvdu7RdVo0jv/3BY=
sha1:MHjd7LT5fjr9h/uEwvWSMwPcklo=
 by: Zyni Moë - Mon, 16 May 2022 18:46 UTC

Stefan Monnier <monnier@iro.umontreal.ca> wrote:

>
> I'd insist here that it's actually not the functions that evaluate their
> arguments, but the general language semantics. By the time the function
> is involved, the arguments have already been evaluated.
>

Is important point yes. In either normal order language or language with
horrible curse of FEXPRs this would not be true.

--
the small snake

Re: Three ways to make-package

<20220516134715.226@kylheku.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.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: Three ways to make-package
Date: Mon, 16 May 2022 20:48:17 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <20220516134715.226@kylheku.com>
References: <7b5490b3-f133-416c-bf07-2a247cfc5f34n@googlegroups.com>
<m3mtfhy6ww.fsf@leonis4.robolove.meer.net>
<jwv4k1plbia.fsf-monnier+comp.lang.lisp@gnu.org>
<t5u66j$896$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 16 May 2022 20:48:17 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="93358c737780a1d0e671d663dbb289ca";
logging-data="30066"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/tfo6BOQN8c8fl01LKBzFrklxGDlFPwOw="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:lGii7AVVqsbfoiMOaZt47h39PjI=
 by: Kaz Kylheku - Mon, 16 May 2022 20:48 UTC

On 2022-05-16, Zyni Moë <no_email@invalid.invalid> wrote:
> Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>
>>
>> I'd insist here that it's actually not the functions that evaluate their
>> arguments, but the general language semantics. By the time the function
>> is involved, the arguments have already been evaluated.
>>
>
> Is important point yes. In either normal order language or language with
> horrible curse of FEXPRs this would not be true.

In normal order it is still true, because it's still the evaluation
strategy which supplies the argument evaluation, not the function *per
se*; the function only refers to arguments, and somehow obtains the
values by doing so.

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

Re: Three ways to make-package

<t5un30$u95$1@dont-email.me>

  copy mid

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

  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: Three ways to make-package
Date: Mon, 16 May 2022 23:34:56 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <t5un30$u95$1@dont-email.me>
References: <7b5490b3-f133-416c-bf07-2a247cfc5f34n@googlegroups.com>
<m3mtfhy6ww.fsf@leonis4.robolove.meer.net>
<jwv4k1plbia.fsf-monnier+comp.lang.lisp@gnu.org>
<t5u66j$896$1@dont-email.me>
<20220516134715.226@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 16 May 2022 23:34:56 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="12fd3b50d0089e5bd6e265965d468018";
logging-data="31013"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18jydk4TmMpS52BiIR0hN0tDsMMdIy3wps="
User-Agent: NewsTap/5.5 (iPad)
Cancel-Lock: sha1:VmUjVzZ1KXVWkqnwfGgRPaWkUg8=
sha1:rIPckmWJVexZrVPvbzJDYwOY+vY=
 by: Zyni Moë - Mon, 16 May 2022 23:34 UTC

Kaz Kylheku <480-992-1380@kylheku.com> wrote:

>
> In normal order it is still true, because it's still the evaluation
> strategy which supplies the argument evaluation, not the function *per
> se*; the function only refers to arguments, and somehow obtains the
> values by doing so.

Yes you are right. Was thinking of normal order as like some explicit
force/delay thing but that is wrong: is really fexprs not normal order.

--
the small snake

Re: Three ways to make-package

<m37d6lx8eh.fsf@leonis4.robolove.meer.net>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: enometh@meer.net (Madhu)
Newsgroups: comp.lang.lisp
Subject: Re: Three ways to make-package
Date: Tue, 17 May 2022 06:49:50 +0530
Organization: Motzarella
Lines: 20
Message-ID: <m37d6lx8eh.fsf@leonis4.robolove.meer.net>
References: <7b5490b3-f133-416c-bf07-2a247cfc5f34n@googlegroups.com>
<m3mtfhy6ww.fsf@leonis4.robolove.meer.net>
<jwv4k1plbia.fsf-monnier+comp.lang.lisp@gnu.org>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="09694fac606758cc3096a0a0464b71f4";
logging-data="29150"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/BLPzQP324gGpNMGkIl6NWsBTiF5hrm9M="
Cancel-Lock: sha1:1ow0xTCnJLtc/gPSlwxB6zl09Cg=
sha1:dTEHo28qkMGz/VvYPnonHgeqIKc=
 by: Madhu - Tue, 17 May 2022 01:19 UTC

* Stefan Monnier <jwv4k1plbia.fsf-monnier+comp.lang.lisp @gnu.org> :
Wrote on Mon, 16 May 2022 11:54:43 -0400:

>> make-package is a function. functions always evaluate their arguments.
>
> I'd insist here that it's actually not the functions that evaluate their
> arguments, but the general language semantics. By the time the function
> is involved, the arguments have already been evaluated.

I'm not inclined to disagree. However there is scope for complicated
defaulting behaviour specified by way of &optional &key &aux - which can
be considered part of the function, and evaluation of these, in order
(heh heh) can be seen as part of evauation of the function.

(on that note there are corner cases with emacs' interactive that i
haven't wrapped my mind around yet)

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor