Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

[We] use bad software and bad machines for the wrong things. -- R. W. Hamming


devel / comp.lang.lisp / Common Lisp - stream designators

SubjectAuthor
* Common Lisp - stream designatorsredsk...@gmail.com
`* Re: Common Lisp - stream designatorsKaz Kylheku
 `- Re: Common Lisp - stream designatorsredsk...@gmail.com

1
Common Lisp - stream designators

<8a511544-26bb-4e20-b44b-a583134d4c80n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
X-Received: by 2002:a05:620a:479a:b0:76d:8404:f17f with SMTP id dt26-20020a05620a479a00b0076d8404f17fmr113823qkb.2.1693644317827;
Sat, 02 Sep 2023 01:45:17 -0700 (PDT)
X-Received: by 2002:a63:9306:0:b0:570:275c:7431 with SMTP id
b6-20020a639306000000b00570275c7431mr987786pge.11.1693644317486; Sat, 02 Sep
2023 01:45:17 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.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: Sat, 2 Sep 2023 01:45:16 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=81.234.49.172; posting-account=-gGlygoAAADapC1RkH70cUmYr6n1D0AV
NNTP-Posting-Host: 81.234.49.172
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8a511544-26bb-4e20-b44b-a583134d4c80n@googlegroups.com>
Subject: Common Lisp - stream designators
From: redsky1066@gmail.com (redsk...@gmail.com)
Injection-Date: Sat, 02 Sep 2023 08:45:17 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2022
 by: redsk...@gmail.com - Sat, 2 Sep 2023 08:45 UTC

Stream designators are conveniences when creating source code. It makes for compact expression.

BUT: can (or should?) stream designators be used deeper down, as entities resolved during actual evaluation?

Specifically wondering about SYNONYM-STREAM.

The [dynamic] variable of such a stream holds the value on which an operation is to be performed.

If that variable is bound to an actual stream object, then everything seems well-defined.

But if that variable is bound to a STREAM DESIGNATOR, is this well-defined? We have for instance the ambiguity of designator NIL (input vs output).

So:
(1) are stream designators formally acceptable as values of the variable for a SYNONYM-STREAM?

(2) if they are not acceptable, do implementations conform to this requirement in a consistent manner?

(3) if they are acceptable, should one avoid using designators for SYNONYM-STREAMs?

(4) are there informative examples that illustrate the pros and cons of using stream designators in the context of SYNONYM-STREAMs?

Re: Common Lisp - stream designators

<20230902075710.819@kylheku.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 864-117-4973@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.lisp
Subject: Re: Common Lisp - stream designators
Date: Sat, 2 Sep 2023 15:13:31 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <20230902075710.819@kylheku.com>
References: <8a511544-26bb-4e20-b44b-a583134d4c80n@googlegroups.com>
Injection-Date: Sat, 2 Sep 2023 15:13:31 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="615329836fb6154f45f8582d7dc5ba06";
logging-data="495087"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+NQ2DC3IOB32C9OKrXynn6VRSAX/QOHsc="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:vPG147L3jtKVCLfjPDEM9m0SqeM=
 by: Kaz Kylheku - Sat, 2 Sep 2023 15:13 UTC

On 2023-09-02, redsk...@gmail.com <redsky1066@gmail.com> wrote:
> Stream designators are conveniences when creating source code. It makes for compact expression.
>
> BUT: can (or should?) stream designators be used deeper down, as entities resolved during actual evaluation?

Since, e.g. format is a function, it takes t and nil as an argument value. Stream designators
are actual values and not just some macro-time syntax.

> Specifically wondering about SYNONYM-STREAM.
>
> The [dynamic] variable of such a stream holds the value on which an operation is to be performed.

The definition of synonym streams doesn't mention stream designators.
The dynamic variable held by the synonym stream is described as having
a stream value, not a stream designator value.

In fact, stream designators are not mentioned in the Streams section of the
spec; only in the Printer setion.

Thus, write takes a stream designator; write-byte doesn't.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Re: Common Lisp - stream designators

<59ee99e3-53a9-41a9-865a-fa678a752679n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
X-Received: by 2002:a05:6214:121:b0:647:1ef1:cea4 with SMTP id w1-20020a056214012100b006471ef1cea4mr263260qvs.6.1693679937394;
Sat, 02 Sep 2023 11:38:57 -0700 (PDT)
X-Received: by 2002:a17:902:d505:b0:1b7:c944:edd4 with SMTP id
b5-20020a170902d50500b001b7c944edd4mr1991623plg.2.1693679936982; Sat, 02 Sep
2023 11:38:56 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.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: Sat, 2 Sep 2023 11:38:56 -0700 (PDT)
In-Reply-To: <20230902075710.819@kylheku.com>
Injection-Info: google-groups.googlegroups.com; posting-host=81.234.49.172; posting-account=-gGlygoAAADapC1RkH70cUmYr6n1D0AV
NNTP-Posting-Host: 81.234.49.172
References: <8a511544-26bb-4e20-b44b-a583134d4c80n@googlegroups.com> <20230902075710.819@kylheku.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <59ee99e3-53a9-41a9-865a-fa678a752679n@googlegroups.com>
Subject: Re: Common Lisp - stream designators
From: redsky1066@gmail.com (redsk...@gmail.com)
Injection-Date: Sat, 02 Sep 2023 18:38:57 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2835
 by: redsk...@gmail.com - Sat, 2 Sep 2023 18:38 UTC

On Saturday, 2 September 2023 at 17:13:37 UTC+2, Kaz Kylheku wrote:
> On 2023-09-02, redsk...@gmail.com <redsk...@gmail.com> wrote:
> > Stream designators are conveniences when creating source code. It makes for compact expression.
> > [snip]
> The definition of synonym streams doesn't mention stream designators.
> The dynamic variable held by the synonym stream is described as having
> a stream value, not a stream designator value.
> [snip]
> --
> TXR Programming Language: http://nongnu.org/txr
> Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
> Mastodon: @Kazi...@mstdn.ca

What you describe is what I would say is the most natural way of understanding this topic. That is, the variable in a SYNONYM-STREAM must have STREAMs as values. Simplifies the dynamics, and eliminates some potential problematic situations.

But as to the object designating a stream in FORMAT, that is, strictly speaking, not a stream designator. Because, as stream designators both T and NIL have a "usage-independent" specific denotations. Use of NIL in FORMAT does not conform with NIL as a *stream* *designator*, as it has a very specific meaning for FORMAT.

So for FORMAT, the denotation of the stream indicator is "usage-dependent", and this stream indicator is resolved to a stream in a very unique way.

This anomaly for FORMAT may be just the remnants of an historical accident, where providers of Common Lisp implementations were not willing to compromise during the standardization process, so we were left with yet another exception in the CL standard.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor