[r6rs-discuss] Continuations and expansion

From: Brian C. Barnes <bcbarnes>
Date: Wed, 25 Jul 2007 01:28:05 -0500

I have an implementation that I've written that is "intended" to be 5.97
complete (there are obviously no compliance tests available at this point),
and it evaluates the given code to #t.

Brian C. Barnes
 
-----Original Message-----
From: r6rs-discuss-bounces at lists.r6rs.org
[mailto:r6rs-discuss-bounces at lists.r6rs.org] On Behalf Of AndrevanTonder
Sent: Tuesday, July 24, 2007 18:29
To: David Van Horn
Cc: r6rs-discuss
Subject: Re: [r6rs-discuss] Continuations and expansion

On Tue, 24 Jul 2007, David Van Horn wrote:

> The following program captures and invokes continuations during
> expansion. I would expect the program to evaluate to #t, which is the
> result according to Andre van Tonder's portable expander, but is this
> behavior specified in the current draft? My impression is yes,
> although I'd like to make sure.

Good question. Maybe one of the other implementors can check if they
get the same result. I am not sure if or how this kind of thing might
interfere with the suggested mark-antimark algorithm, which I do not use.

I am not even sure if this kind of thing is guaranteed to always work even
with my expander, since I do have some uses of global state. So if a
user macro transformer is allowed to return twice, I supect (but cannot say
for certain right now) that inconsistencies might occur.

For this reason, it might have been a good idea to include a statement in
the
draft to the effect that the result of returning more than once from a
transformer invocation is unspecified.

> (syntax-let/cc k
> (begin
> (syntax-invoke/c k #t)
> (let)))

I do not think this can be portable as is, since the expansion order of
expression-begin sequences is not specified as far as I know. On the
other hand, if you replace (BEGIN ---) by (LET () ---), then the question
remains open.

Cheers
Andre

_______________________________________________
r6rs-discuss mailing list
r6rs-discuss at lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss
Received on Wed Jul 25 2007 - 02:28:05 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:01 UTC