Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

One can't proceed from the informal to the formal by formal means.


devel / comp.lang.lisp / CLHS on *DEBUG-IO* and others

SubjectAuthor
* CLHS on *DEBUG-IO* and othersSpiros Bousbouras
+- Re: CLHS on *DEBUG-IO* and othersKaz Kylheku
`* Re: CLHS on *DEBUG-IO* and othersLawrence D'Oliveiro
 `* Re: CLHS on *DEBUG-IO* and othersSpiros Bousbouras
  `* Re: CLHS on *DEBUG-IO* and othersKaz Kylheku
   +* Synonym StreamsAlan Bawden
   |+- Re: Synonym StreamsSpiros Bousbouras
   |`* Re: Synonym Streamssteve
   | +- Re: Synonym StreamsAlan Bawden
   | `* Re: Synonym StreamsLawrence D'Oliveiro
   |  `- Re: Synonym Streamssteve
   `* Re: CLHS on *DEBUG-IO* and othersSpiros Bousbouras
    `- Re: CLHS on *DEBUG-IO* and othersKaz Kylheku

1
CLHS on *DEBUG-IO* and others

<6pd1+E7bUWxwHGM59@bongo-ra.co>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: spibou@gmail.com (Spiros Bousbouras)
Newsgroups: comp.lang.lisp
Subject: CLHS on *DEBUG-IO* and others
Date: Sat, 17 Feb 2024 14:08:29 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <6pd1+E7bUWxwHGM59@bongo-ra.co>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 17 Feb 2024 14:08:29 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e9048995647ff489b8a80c811bb06598";
logging-data="476267"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1991V/AFeIkMet+67/kH0Is"
Cancel-Lock: sha1:jskQ3dLYT2m+MEtMFUyd9phMelM=
X-Server-Commands: nowebcancel
X-Organisation: Weyland-Yutani
 by: Spiros Bousbouras - Sat, 17 Feb 2024 14:08 UTC

CLHS says

Initial Value:
implementation-dependent, but it must be an open stream that is not a
generalized synonym stream to an I/O customization variables but that
might be a generalized synonym stream to the value of some I/O
customization variable.

This doesn't make sense. So what does it actually mean ? Taking into account
what "issue" STANDARD-INPUT-INITIAL-BINDING:DEFINED-CONTRACTS says I think
the intended meaning is

.... that is not a generalized synonym stream to any of the standard I/O
customization variables but that might be a generalized synonym stream to
the value of some implementation defined I/O customization variable.

Re: CLHS on *DEBUG-IO* and others

<20240217083004.983@kylheku.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!news.swapon.de!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 433-929-6894@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.lisp
Subject: Re: CLHS on *DEBUG-IO* and others
Date: Sat, 17 Feb 2024 16:34:02 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <20240217083004.983@kylheku.com>
References: <6pd1+E7bUWxwHGM59@bongo-ra.co>
Injection-Date: Sat, 17 Feb 2024 16:34:02 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ac2d9852db37cde2d086c1f0ee8adffa";
logging-data="531614"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/kFvMeZCz61nOgolcENDRJuDgHItsteuE="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:NpUOdmaCX1t+T+G/rKhMg0tyxGg=
 by: Kaz Kylheku - Sat, 17 Feb 2024 16:34 UTC

On 2024-02-17, Spiros Bousbouras <spibou@gmail.com> wrote:
> CLHS says
>
> Initial Value:
> implementation-dependent, but it must be an open stream that is not a
> generalized synonym stream to an I/O customization variables but that
> might be a generalized synonym stream to the value of some I/O
> customization variable.

This seems to be because generalized synonym stream means two things:
it can target stream objects or symbols. It seems to be saying that
*debug-io* may be the same stream as one held in another such variable,
but not an alias for such a variable itself.

In other words the requirement seems to be that if *debug-io* were, say,
the same as *stdandard-output*, and the application assigns or binds a
new value to *standard-output*, *debug-io* must not be affected.

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

Re: CLHS on *DEBUG-IO* and others

<uqtv0o$1fckl$2@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.lisp
Subject: Re: CLHS on *DEBUG-IO* and others
Date: Sun, 18 Feb 2024 22:06:16 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <uqtv0o$1fckl$2@dont-email.me>
References: <6pd1+E7bUWxwHGM59@bongo-ra.co>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 18 Feb 2024 22:06:16 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="297432ee8be2f2c4ce47ce2a25257ed8";
logging-data="1553045"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19gkyZyMghVOaOh3I/YGj9q"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:apNBsvsl6FvP7lZSDQMJLr3jlfc=
 by: Lawrence D'Oliv - Sun, 18 Feb 2024 22:06 UTC

On Sat, 17 Feb 2024 14:08:29 -0000 (UTC), Spiros Bousbouras wrote:

> CLHS says
>
> Initial Value:
> implementation-dependent, but it must be an open stream that is not
> a generalized synonym stream to an I/O customization variables but
> that might be a generalized synonym stream to the value of some I/O
> customization variable.
>
> This doesn't make sense.

It could if “an I/O customization variables” is a typo for “any I/O
customization variables”. Note that *debug-io* is in the list of these
variables in the glossary entry.

This is getting beyond my LISP-fu, but is “stream to a variable” distinct
from “stream to the value of a variable”?

Re: CLHS on *DEBUG-IO* and others

<23FZrFyCKlaZfJP1R@bongo-ra.co>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: spibou@gmail.com (Spiros Bousbouras)
Newsgroups: comp.lang.lisp
Subject: Re: CLHS on *DEBUG-IO* and others
Date: Mon, 19 Feb 2024 12:09:59 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <23FZrFyCKlaZfJP1R@bongo-ra.co>
References: <6pd1+E7bUWxwHGM59@bongo-ra.co> <uqtv0o$1fckl$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 19 Feb 2024 12:09:59 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c4ab8ec8448de2f6e5317524027c3e8f";
logging-data="1965482"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+pjhaCePxI3fPLR1x6rHXu"
Cancel-Lock: sha1:hFJBoecs2ZZ3zVfV/XrvEpYPHQQ=
X-Organisation: Weyland-Yutani
X-Server-Commands: nowebcancel
In-Reply-To: <uqtv0o$1fckl$2@dont-email.me>
 by: Spiros Bousbouras - Mon, 19 Feb 2024 12:09 UTC

On Sun, 18 Feb 2024 22:06:16 -0000 (UTC)
Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
> On Sat, 17 Feb 2024 14:08:29 -0000 (UTC), Spiros Bousbouras wrote:
>
> > CLHS says
> >
> > Initial Value:
> > implementation-dependent, but it must be an open stream that is not
> > a generalized synonym stream to an I/O customization variables but
> > that might be a generalized synonym stream to the value of some I/O
> > customization variable.
> >
> > This doesn't make sense.
>
> It could if “an I/O customization variables” is a typo for “any I/O
> customization variables”. Note that *debug-io* is in the list of these
> variables in the glossary entry.
>
> This is getting beyond my LISP-fu, but is “stream to a variable” distinct
> from “stream to the value of a variable”?

Based on what the CLHS page for System Class SYNONYM-STREAM says ,
I can't think of a meaningful distinction.

Re: CLHS on *DEBUG-IO* and others

<20240219092306.348@kylheku.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!news.swapon.de!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 433-929-6894@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.lisp
Subject: Re: CLHS on *DEBUG-IO* and others
Date: Mon, 19 Feb 2024 17:40:29 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 83
Message-ID: <20240219092306.348@kylheku.com>
References: <6pd1+E7bUWxwHGM59@bongo-ra.co> <uqtv0o$1fckl$2@dont-email.me>
<23FZrFyCKlaZfJP1R@bongo-ra.co>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 19 Feb 2024 17:40:29 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="46f1d206536810fd4dc2206a713d6cf1";
logging-data="2102568"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19IAgk8x16udvn9V9NpKxB279+is0gPz34="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:EZ2i2b1N7wyIR+GmyIyg5taxLo0=
 by: Kaz Kylheku - Mon, 19 Feb 2024 17:40 UTC

On 2024-02-19, Spiros Bousbouras <spibou@gmail.com> wrote:
> On Sun, 18 Feb 2024 22:06:16 -0000 (UTC)
> Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
>> On Sat, 17 Feb 2024 14:08:29 -0000 (UTC), Spiros Bousbouras wrote:
>>
>> > CLHS says
>> >
>> > Initial Value:
>> > implementation-dependent, but it must be an open stream that is not
>> > a generalized synonym stream to an I/O customization variables but
>> > that might be a generalized synonym stream to the value of some I/O
>> > customization variable.
>> >
>> > This doesn't make sense.
>>
>> It could if “an I/O customization variables” is a typo for “any I/O
>> customization variables”. Note that *debug-io* is in the list of these
>> variables in the glossary entry.
>>
>> This is getting beyond my LISP-fu, but is “stream to a variable” distinct
>> from “stream to the value of a variable”?
>
> Based on what the CLHS page for System Class SYNONYM-STREAM says ,
> I can't think of a meaningful distinction.

The glossary makes it clear. The principal meaning (1) of synonym
stream is that it's an object made by make-synonym-stream.

The target of a synonym stream is a dynamic variable name.

So if we call (make-synonym-stream '*standrad-output*) we get an
object that tracks the value of *standard-output*. If the value
of *standard-output* changes, that synonym stream becomes a
synonym to a different stream. (Note: in my dialet of English, I prefer
"synonym of" rather than "synonym to").

The Glossary also says that "synonym stream" has relative usages:
we can speak about a synonym stream to a symbol, and a synonym
stream to a stream. The latter refers to the value of a symbol.
If S is a stream which is the current value of *standard-output*,
then our above object is a synonym to that stream (at the moment),
as well as a synonym to the *standard-output* symbol.

So then, what is this:

implementation-dependent, but it must be an open stream that is not
a generalized synonym stream to an I/O customization variables but
that might be a generalized synonym stream to the value of some I/O
customization variable.

It is saying that *debug-io* cannot be a synonym stream to another such
a variable. For instance, *debug-io* will not be an object created
by (make-synonym-stream '*standard-output*). If we bind or assign
*standard-output*, *debug-io* must not change.

However, *debug-io* is allowed to be a synonym stream (thus necessarily
to some dynamic variable symbol), and that symbol can have the same
stream as *standard-output* as its initial value.

It looks like ANSI CL is trying to impose the requirement that those
stream variables are independent (not tied together as synonyms) without
imposing the requirement that they may not be generalized synonym
streams.

So this would be conforming:

(defvar sys:internal-standard-ouptut ...)

(defvar *debug-io* (make-synonym-stream 'sys:internal-standard-ouptut))
(defvar *standard-output* (make-synonym-stream 'sys:internal-standard-ouptut))

Binding/assigning *debug-io* or *standard-ouptut* has no effect on
the other, but they are initially synonyms of
sys:internal-standrad-output, and so if that variable changes, they
both change.

This is allowed because sys:internal-standard-output is not one of the
public stream variables.

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

Synonym Streams

<867cj0qfbq.fsf_-_@williamsburg.bawden.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!usenet.network!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!bawden.eternal-september.org!.POSTED!not-for-mail
From: alan@csail.mit.edu (Alan Bawden)
Newsgroups: comp.lang.lisp
Subject: Synonym Streams
Date: Mon, 19 Feb 2024 17:06:33 -0500
Organization: ITS Preservation Society
Lines: 21
Message-ID: <867cj0qfbq.fsf_-_@williamsburg.bawden.org>
References: <6pd1+E7bUWxwHGM59@bongo-ra.co> <uqtv0o$1fckl$2@dont-email.me>
<23FZrFyCKlaZfJP1R@bongo-ra.co> <20240219092306.348@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: bawden.eternal-september.org; posting-host="3365d5f8482e8cecf2040c59ef4e7930";
logging-data="2211915"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+7D44ZUoU+iHtGP0llwpCB"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)
Cancel-Lock: sha1:5ZZzHH0PzbQprMp9jUTO9kFkHtU=
sha1:GL5E1pOGguz07apMutW8OV6WoTk=
 by: Alan Bawden - Mon, 19 Feb 2024 22:06 UTC

I no longer remember why we designed this whole synonym stream thing.
(Where by "we" I really mean Dan Weinreb and Dave Moon, I was mostly
just in the room when they did this.) I _think_ it is mimicking
something that the Multics I/O system does.

I'm not aware of any modern system where I/O has this feature. It is
true that modern streams are often wrapped around other streams to
compose features (a text string may wrap a binary stream which may in
turn wrap an unbuffered stream, etc.), but the idea of one stream
wrapping another as an _indirection_ mechanism, so that you can
dynamically replace the wrapped stream with a different one, seems
unique to Common Lisp.

I'm not sure what problem it solves, since I don't remember ever wanting
to use it in Common Lisp (or wishing I had something like it when
programming in Java, Python, or C). Buy maybe I'm forgetting something.

I would be interested to know of any place that _does_ use synonym
streams to solve some real problem.

- Alan

Re: CLHS on *DEBUG-IO* and others

<6SDCTIbJa=4V3HYzK@bongo-ra.co>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!nntp.comgw.net!paganini.bofh.team!not-for-mail
From: spibou@gmail.com (Spiros Bousbouras)
Newsgroups: comp.lang.lisp
Subject: Re: CLHS on *DEBUG-IO* and others
Date: Tue, 20 Feb 2024 17:47:09 -0000 (UTC)
Organization: To protect and to server
Message-ID: <6SDCTIbJa=4V3HYzK@bongo-ra.co>
References: <6pd1+E7bUWxwHGM59@bongo-ra.co> <uqtv0o$1fckl$2@dont-email.me> <23FZrFyCKlaZfJP1R@bongo-ra.co>
<20240219092306.348@kylheku.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 20 Feb 2024 17:47:09 -0000 (UTC)
Injection-Info: paganini.bofh.team; logging-data="2021032"; posting-host="9H7U5kayiTdk7VIdYU44Rw.user.paganini.bofh.team"; mail-complaints-to="usenet@bofh.team"; posting-account="9dIQLXBM7WM9KzA+yjdR4A";
Cancel-Lock: sha256:xPE/PD3P/iqqsnus81u8vZPHxyH6lMSkv1BBT3AJ7V8=
X-Organisation: Weyland-Yutani
X-Server-Commands: nowebcancel
X-Notice: Filtered by postfilter v. 0.9.3
 by: Spiros Bousbouras - Tue, 20 Feb 2024 17:47 UTC

On Mon, 19 Feb 2024 17:40:29 -0000 (UTC)
Kaz Kylheku <433-929-6894@kylheku.com> wrote:
> So then, what is this:
>
> implementation-dependent, but it must be an open stream that is not
> a generalized synonym stream to an I/O customization variables but
> that might be a generalized synonym stream to the value of some I/O
> customization variable.
>
> It is saying that *debug-io* cannot be a synonym stream to another such
> a variable. For instance, *debug-io* will not be an object created
> by (make-synonym-stream '*standard-output*). If we bind or assign
> *standard-output*, *debug-io* must not change.
>
> However, *debug-io* is allowed to be a synonym stream (thus necessarily
> to some dynamic variable symbol), and that symbol can have the same
> stream as *standard-output* as its initial value.
>
> It looks like ANSI CL is trying to impose the requirement that those
> stream variables are independent (not tied together as synonyms) without
> imposing the requirement that they may not be generalized synonym
> streams.
>
> So this would be conforming:
>
> (defvar sys:internal-standard-ouptut ...)
>
> (defvar *debug-io* (make-synonym-stream 'sys:internal-standard-ouptut))
> (defvar *standard-output* (make-synonym-stream 'sys:internal-standard-ouptut))
>
> Binding/assigning *debug-io* or *standard-ouptut* has no effect on
> the other, but they are initially synonyms of
> sys:internal-standrad-output, and so if that variable changes, they
> both change.
>
> This is allowed because sys:internal-standard-output is not one of the
> public stream variables.

And how is this different from what I wrote in my opening post , namely

.... that is not a generalized synonym stream to any of the standard I/O
customization variables but that might be a generalized synonym stream to
the value of some implementation defined I/O customization variable.

?

--
vlaho.ninja/menu

Re: Synonym Streams

<lStmQJdXRZ69KcmdG@bongo-ra.co>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!news.chmurka.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: spibou@gmail.com (Spiros Bousbouras)
Newsgroups: comp.lang.lisp
Subject: Re: Synonym Streams
Date: Tue, 20 Feb 2024 17:54:42 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 47
Message-ID: <lStmQJdXRZ69KcmdG@bongo-ra.co>
References: <6pd1+E7bUWxwHGM59@bongo-ra.co> <uqtv0o$1fckl$2@dont-email.me> <23FZrFyCKlaZfJP1R@bongo-ra.co>
<20240219092306.348@kylheku.com> <867cj0qfbq.fsf_-_@williamsburg.bawden.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 20 Feb 2024 17:54:42 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e33696b8a59f014ea92175c03fb70b9f";
logging-data="2763674"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+3zxQzqs21RHQQmDUbJCmZ"
Cancel-Lock: sha1:0Of1DZIsi1i0iRCpKWtdC4uAO+4=
X-Organisation: Weyland-Yutani
X-Server-Commands: nowebcancel
In-Reply-To: <867cj0qfbq.fsf_-_@williamsburg.bawden.org>
 by: Spiros Bousbouras - Tue, 20 Feb 2024 17:54 UTC

On Mon, 19 Feb 2024 17:06:33 -0500
Alan Bawden <alan@csail.mit.edu> wrote:
> I no longer remember why we designed this whole synonym stream thing.
> (Where by "we" I really mean Dan Weinreb and Dave Moon, I was mostly
> just in the room when they did this.) I _think_ it is mimicking
> something that the Multics I/O system does.

Well , there does exist multicians.org/rjf.html :

Another class of DIM is one that translates one I/O call to another I/O
call, i.e., its pseudo-device is a stream. A stream that is used as a
pseudo-device is termed an object stream. The most important of this
class of DIMs is the "synonym" module. When an attachment is made via the
synonym module the specified device is another stream. Any subsequent
calls to the first stream is transformed by the synonym module to the
same call on the latter stream. The stream names are, therefore,
synonymous.

Applications

In the Multics system certain stream names are established, by
convention, for normal use. The first of these is "user_i/o". This stream
is normally associated with the use;'s primary I/O device, e.g., in a
normal console session "user_i/o" will be attached to the user's console.
Two other stream names are also established: "user_input" and
"user_output". These streams are normally attached to "user_i/o" via the
"synonym" module as illustrated in Figure 3a, i.e. , they are made
equivalent to "user_i/o". Since at present most programs that perform I/O
intended to do so with the user's console, the stream names "user_output"
and "user_input" are the ones used in calls-to the I/O System in these
programs. This illustrates one of the important purposes of the "synonym"
DIM, to permit the manipulation of stream attachments without having to
attach and detach physical devices. The streams "user_input" and
"user_output" could normally be attached directly to the user's console
as shown in Figure 3b. However, this would force the console to be
detached whenever these streams were attached to some other device.
Detachment and subsequent reattachment implies that certain physical
hardware action has been taken with regard to the device. In the use of a
console this might include termination of communication with the console
and subsequently having to reestablish this communication. It would not
be difficult to indicate to the DIM to keep the device active, however,
the use of synonyms is more straightforward and makes more visible the
states of various devices, i.e., if they are attached they are active. In
other words, synonyms are an easy, efficient method of changing the
binding of streams to devices. Because of this use of synonyms the
"synonym" DIM has been highly optimized for the simple switching
described above.

Re: CLHS on *DEBUG-IO* and others

<20240220101518.436@kylheku.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 433-929-6894@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.lisp
Subject: Re: CLHS on *DEBUG-IO* and others
Date: Tue, 20 Feb 2024 18:18:45 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <20240220101518.436@kylheku.com>
References: <6pd1+E7bUWxwHGM59@bongo-ra.co> <uqtv0o$1fckl$2@dont-email.me>
<23FZrFyCKlaZfJP1R@bongo-ra.co> <20240219092306.348@kylheku.com>
<6SDCTIbJa=4V3HYzK@bongo-ra.co>
Injection-Date: Tue, 20 Feb 2024 18:18:45 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="3ab2e551e8ae33ebc6759ce27449afd3";
logging-data="2772997"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/omIdGcnwDPHUEQ/8qqRvNwB5qlvIioXo="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:SnnOTfKRKnGak76l9rYjyhsyjqs=
 by: Kaz Kylheku - Tue, 20 Feb 2024 18:18 UTC

On 2024-02-20, Spiros Bousbouras <spibou@gmail.com> wrote:
> And how is this different from what I wrote in my opening post , namely
>
> .... that is not a generalized synonym stream to any of the standard I/O
> customization variables but that might be a generalized synonym stream to
> the value of some implementation defined I/O customization variable.

I wrote with the objective that my written understanding not be
different from what the above means. If you also find that so, it
increases my confidence.

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

Re: Synonym Streams

<8734roez2s.fsf@gmail.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!feeder.usenetexpress.com!tr3.iad1.usenetexpress.com!69.80.99.27.MISMATCH!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Sun, 14 Apr 2024 15:36:12 +0000
From: sgonedes1977@gmail.com (steve)
Newsgroups: comp.lang.lisp
Subject: Re: Synonym Streams
References: <6pd1+E7bUWxwHGM59@bongo-ra.co> <uqtv0o$1fckl$2@dont-email.me> <23FZrFyCKlaZfJP1R@bongo-ra.co> <20240219092306.348@kylheku.com> <867cj0qfbq.fsf_-_@williamsburg.bawden.org>
Date: Sun, 14 Apr 2024 11:36:11 -0400
Message-ID: <8734roez2s.fsf@gmail.com>
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:qbsZmmH4/M+cVEPXqJbnOM7FpaE=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Lines: 54
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-uIGVqe6N2HiQaplOV95qlEaJCfkl3iucTl75mA/wmV6WL+ScRTaxdSZ5DXt6oBst4npVpOCI+AxGuKj!y/R+O1OCSeTbzc8dPZpp0cCGXKhuhT5pCy5o3O6jz+DgGQ==
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
 by: steve - Sun, 14 Apr 2024 15:36 UTC

Alan Bawden <alan@csail.mit.edu> writes:

> I no longer remember why we designed this whole synonym stream thing.

[ ... ]

bivalent streams are useful.

"In addition, SBCL supports various extensions of ANSI Common Lisp
streams:

*Bivalent Streams*
A type of stream that can read and write both ‘character’ and
‘(unsigned-byte 8)’ values.

> I'm not aware of any modern system where I/O has this feature.

POSIX man dup

> I would be interested to know of any place that _does_ use synonym

I use the following for type 1 font dissasembler. I do not have the code
right now, but bivalent streams make it much easier to
read-char/read-byte.

;;
;;; Macros

(defmacro with-open-file-stream (direction type options &body body)
`(with-open-file
(,@options :direction ,direction :element-type ,type)
,@body))

(defmacro with-binary-input-stream (options &body forms)
`(with-open-file-stream :input '(unsigned-byte 8) ,options ,@forms))

(defmacro with-ascii-input-stream (options &body forms)
`(with-open-file-stream :input 'character ,options ,@forms))

(defmacro with-ascii-output-stream (options &body forms)
`(with-open-file-stream :output 'character ,options ,@forms))

(defmacro with-binary-output-stream (options &body forms)
`(with-open-file-stream :output '(unsigned-byte 8) ,options ,@forms))

> streams to solve some real problem.

i do not have real problems.

> - Alan

steve

Re: Synonym Streams

<8634rno8zr.fsf@williamsburg.bawden.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!bawden.eternal-september.org!.POSTED!not-for-mail
From: alan@csail.mit.edu (Alan Bawden)
Newsgroups: comp.lang.lisp
Subject: Re: Synonym Streams
Date: Sun, 14 Apr 2024 18:49:28 -0400
Organization: ITS Preservation Society
Lines: 49
Message-ID: <8634rno8zr.fsf@williamsburg.bawden.org>
References: <6pd1+E7bUWxwHGM59@bongo-ra.co> <uqtv0o$1fckl$2@dont-email.me>
<23FZrFyCKlaZfJP1R@bongo-ra.co> <20240219092306.348@kylheku.com>
<867cj0qfbq.fsf_-_@williamsburg.bawden.org> <8734roez2s.fsf@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 15 Apr 2024 00:49:31 +0200 (CEST)
Injection-Info: bawden.eternal-september.org; posting-host="db96abda36b57175e5859ec2315adb6f";
logging-data="4074860"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX192NyTsc2R827SNxKHYLEL9"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)
Cancel-Lock: sha1:ZPdY3MplbOf5Q6sFUUvHsIF7i4w=
sha1:VdPLaZdlO6zXFte2QJtKJyxDGvs=
 by: Alan Bawden - Sun, 14 Apr 2024 22:49 UTC

steve <sgonedes1977@gmail.com> writes:

Alan Bawden <alan@csail.mit.edu> writes:

> I no longer remember why we designed this whole synonym stream thing.

[ ... ]

bivalent streams are useful.

"In addition, SBCL supports various extensions of ANSI Common Lisp
streams:

*Bivalent Streams*
A type of stream that can read and write both ‘character’ and
‘(unsigned-byte 8)’ values.

I don't see any connection with synonym streams here.

> I'm not aware of any modern system where I/O has this feature.

POSIX man dup

This does not make a synonym in the sense that Common Lisp is using the
word. If it made a synonym (in the Common Lisp sense) then after:

old = open("old_file", O_RDONLY);
new = open("new_file", O_RDONLY);
fd = dup(old);
dup2(new, old);

it would be the case that reading from FD would read from "new_file".
But if you try it, you will find that FD is still reading from "old_file".

> I would be interested to know of any place that _does_ use synonym

I use the following for type 1 font dissasembler. I do not have the code
right now, but bivalent streams make it much easier to
read-char/read-byte.

The code you included isn't using synonym streams.

I think you haven't fully internalized what a weird feature synonym
streams really are. Its easy to breeze through the documentation and
think that a synonym stream is just a way to duplicate a stream. But
it's more than that: The new stream follows the _current_ value of a
dynamic variable.

- Alan

Re: Synonym Streams

<uvhtj1$3th0n$7@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.lisp
Subject: Re: Synonym Streams
Date: Mon, 15 Apr 2024 00:49:38 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <uvhtj1$3th0n$7@dont-email.me>
References: <6pd1+E7bUWxwHGM59@bongo-ra.co> <uqtv0o$1fckl$2@dont-email.me>
<23FZrFyCKlaZfJP1R@bongo-ra.co> <20240219092306.348@kylheku.com>
<867cj0qfbq.fsf_-_@williamsburg.bawden.org> <8734roez2s.fsf@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 15 Apr 2024 02:49:38 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="2acb11c3364910c2dba94812b909635b";
logging-data="4113431"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18fzoOE0Jm7J0k6ZClf6Qjf"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:59wVf/VHWxQzIWRtDiwfFzrugCQ=
 by: Lawrence D'Oliv - Mon, 15 Apr 2024 00:49 UTC

On Sun, 14 Apr 2024 11:36:11 -0400, steve wrote:

> *Bivalent Streams*
> A type of stream that can read and write both ‘character’ and
> ‘(unsigned-byte 8)’ values.

How is that supposed to work, exactly? Is each stream item tagged in some
way to identify it as a “character” versus an “unsigned-byte 8”?

Re: Synonym Streams

<87frvhl012.fsf@gmail.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!border-3.nntp.ord.giganews.com!border-4.nntp.ord.giganews.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Fri, 19 Apr 2024 17:44:58 +0000
From: sgonedes1977@gmail.com (steve)
Newsgroups: comp.lang.lisp
Subject: Re: Synonym Streams
References: <6pd1+E7bUWxwHGM59@bongo-ra.co> <uqtv0o$1fckl$2@dont-email.me>
<23FZrFyCKlaZfJP1R@bongo-ra.co> <20240219092306.348@kylheku.com>
<867cj0qfbq.fsf_-_@williamsburg.bawden.org> <8734roez2s.fsf@gmail.com>
<uvhtj1$3th0n$7@dont-email.me>
Date: Fri, 19 Apr 2024 13:44:57 -0400
Message-ID: <87frvhl012.fsf@gmail.com>
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:L49SE/PHG48pJvZ2Ors8ypYx+Sc=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Lines: 27
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-vK8qKAiVyThbuWGyPPUGBTOQ3u8pZI7xVxEOJ+cK4bmTm2NyL2mMCnEfG5I1pJwboByamBbWflhaSB3!PR4pt7cTOCQDvZfSVbWmGbvFCEN2OaIqome8B/K2KsWNPw==
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
 by: steve - Fri, 19 Apr 2024 17:44 UTC

Lawrence D'Oliveiro <ldo@nz.invalid> writes:

> On Sun, 14 Apr 2024 11:36:11 -0400, steve wrote:
>
< > *Bivalent Streams*
< > A type of stream that can read and write both ‘character’ and
< > ‘(unsigned-byte 8)’ values.
>
> How is that supposed to work, exactly? Is each stream item tagged in some
> way to identify it as a “character” versus an “unsigned-byte 8”?

I don't have any code at the moment - you could use 'base-char which
includes

(with-open-file (out "/home/steve/file.txt" :direction :output :element-type 'base-char :if-exists :overwrite)
(write-string "this" out)
(terpri out)
(write out :stream out))
#<SB-SYS:FD-STREAM for "file /home/steve/file.txt" {1002E2A943}>
CL-USER>

File :
this
#<SB-SYS:FD-STREAM for "file /home/steve/file.txt" {1002E2A943}>

hope this helps...

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor