Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

"Don't fear the pen. When in doubt, draw a pretty picture." -- Baker's Third Law of Design.


devel / comp.lang.scheme / Final SRFI 226: Control Features

SubjectAuthor
o Final SRFI 226: Control FeaturesArthur A. Gleckler

1
Final SRFI 226: Control Features

<80015890-8b93-4ef2-996a-fa0fadf018b8n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.scheme
X-Received: by 2002:ae9:e713:0:b0:74d:e887:167 with SMTP id m19-20020ae9e713000000b0074de8870167mr4161269qka.10.1682466561999;
Tue, 25 Apr 2023 16:49:21 -0700 (PDT)
X-Received: by 2002:a05:622a:1808:b0:3ef:415f:189 with SMTP id
t8-20020a05622a180800b003ef415f0189mr7758709qtc.6.1682466561682; Tue, 25 Apr
2023 16:49:21 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.scheme
Date: Tue, 25 Apr 2023 16:49:21 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=12.38.208.106; posting-account=LxAb6woAAAC1lFA0Q2auCNpmd7EXgVPk
NNTP-Posting-Host: 12.38.208.106
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <80015890-8b93-4ef2-996a-fa0fadf018b8n@googlegroups.com>
Subject: Final SRFI 226: Control Features
From: *@speechcode.com (Arthur A. Gleckler)
Injection-Date: Tue, 25 Apr 2023 23:49:21 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Arthur A. Gleckler - Tue, 25 Apr 2023 23:49 UTC

Scheme Request for Implementation 226,
"Control Features",
by Marc Nieper-Wißkirchen,
has gone into final status.

The document and an archive of the discussion are available at https://srfi..schemers.org/srfi-226/.

Here's the abstract:

Whenever an expression is evaluated during the run of a Scheme
program, there is a continuation awaiting the values of the
expression. It is a distinguishing property of the Scheme programming
language to offer a procedure (named call/cc) that captures the
current continuation as a procedure, which, when called, aborts the
then-current continuation and reinstates the captured one.

One can visualize a continuation as a list of (continuation) frames
where a non-tail call adds a frame to the top of the list and where
the return from a non-tail call removes the appropriate frame.

Moreover, each expression is evaluated in a dynamic environment that
conceptually holds the values of parameters like the current output
port and the dynamic-wind stack at the point of evaluation. As the
dynamic environment is captured and reinstated along the continuation
when the call/cc machinery is used, we can view it conceptually as
part of the continuation.

The libraries defined in this SRFI are all concerned with
continuations in a wider sense. More specifically, the topics are as
follows:

Continuation Prompts
A continuation prompt is a special continuation frame that is tagged
with a so-called prompt tag. Procedures to install continuation
prompts and to abort the current continuation and escape back to a
previously installed continuation prompt are provided. Moreover,
continuation prompts are equipped with handlers that are invoked when
a continuation is aborted to them.

Continuations
When continuations are captured, the list of captured continuation
frames is always delimited by some continuation prompt. This extends
the semantics of Scheme’s call-with-current-continuation. Moreover, a
procedure to capture so-called composable continuations is
provided. As opposed to continuations captured by
call-with-current-continuation, invoking a composable continuation
does not abort the then-current continuation, so composable
continuations behave like ordinary procedures. Together with
continuation prompts, composable continuations allow one to implement
the various proposed sets of control operators for delimited
continuations. Finally, a primitive (call-in-continuation) is provided
that allows calling a procedure in a given continuation instead of
just delivering values to it.

Continuation Marks
Continuation marks are a provided feature that allows one to attach
arbitrary information to continuation frames that is captured and
reinstated along with the rest of the continuation. Conceptually,
exception handlers and parameters are implemented in terms of
continuation marks, but the syntax and procedures defined in this SRFI
allow the user to use them in more general ways. Moreover, they reify
the notion of a tail call, allowing one, for example, to test for tail
context.

Exceptions
The exception mechanism of R6RS and R7RS is reinterpreted with respect
to the concepts introduced in this SRFI. (Here, and in what follows we
mean the so-called small language when we speak about R7RS.) Moreover,
the with-exception-handler procedure and the guard syntax gain
additional tail-context guarantees.

Parameters
The parameter object mechanism of SRFI 39 and R7RS is reinterpreted
with respect to the concepts introduced in this SRFI. Procedures to
retrieve the current parameterization and to reinstall it later are
provided. Moreover, the parameterize syntax gains an additional
tail-context guarantee. To support an alternative model of parameters
that is linked to the dynamic extent and not to the current
parameterization, the notion of a parameter-like object and the
temporarily syntax are introduced. Fluids Fluids are a syntactic
reinterpretation of parameter objects.

Delayed evaluation
The syntax and procedures on delayed evaluation of R7RS are revisited
and redefined to handle the following satisfactorily: the
parameterization of the delayed expression being forced, the treatment
of exceptions raised during forcing of delayed expressions, and
iterative lazy algorithms. Moreover, their semantics are detailed with
respect to the concepts introduced in this SRFI, and promises can
naturally deliver an arbitrary number of values when being
forced. Finally, the initial continuation of a delayed expression
being forced is defined in a way that makes it interchangeable with
the initial continuation of a thread.

Threads
The thread mechanism of SRFI 18 is detailed with respect to the
concepts introduced in this SRFI. In particular, mutation of parameter
objects in multi-threaded applications is specified. In order to
support timeout arguments in a type-safe way, a minimal API on time
objects is included as well.

Large parts of this SRFI have been inspired by the control operators provided by Racket.

Here is the commit summary since the most recent draft:

- Use <dl> when defining terms.
- editorial changes, part of finalization review
- Add example for shift-at/reset-at.
- More fixes following Arthur's review
- Fix definition of current-continuation-marks
- HTML fixes.
- Example for continuation-mark-set->iterator
- Add example for continuation-marks and fix sample impl.
- Fix spelling.
- Fix errors reported by W3C HTML Validator.
- Fix whitespace.
- Finalize.

Here are the diffs since the most recent draft:

<https://github.com/scheme-requests-for-implementation/srfi-226/compare/draft-8..final>

Many thanks to Marc and to everyone who contributed to the discussion of this SRFI.

Regards,

SRFI Editor

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor