Re: Opaque syntax objects Andre van Tonder (12 Aug 2005 21:24 UTC)
Re: Opaque syntax objects Jens Axel Søgaard (13 Aug 2005 00:10 UTC)
Re: Opaque syntax objects Andre van Tonder (13 Aug 2005 00:51 UTC)
Re: Opaque syntax objects Jens Axel Søgaard (14 Aug 2005 20:08 UTC)
Re: Opaque syntax objects Andre van Tonder (14 Aug 2005 20:49 UTC)
Re: Opaque syntax objects Jens Axel Søgaard (14 Aug 2005 21:16 UTC)
Re: Opaque syntax objects Andre van Tonder (13 Aug 2005 02:35 UTC)
Re: Opaque syntax objects Jens Axel Søgaard (14 Aug 2005 20:37 UTC)
Re: Opaque syntax objects Michael Sperber (13 Aug 2005 07:51 UTC)
Re: Opaque syntax objects [course positions] Per Bothner (14 Aug 2005 06:19 UTC)

Re: Opaque syntax objects Jens Axel Søgaard 14 Aug 2005 20:37 UTC

Andre van Tonder wrote:
> On Sat, 13 Aug 2005, [ISO-8859-1] Jens Axel Søgaard wrote:
>> Andre van Tonder wrote:

>>>  As we know, subtyping can be thought of in terms of implicit
>>> coercions. The alternative is having explicit coercions as in PLT,
>>> the  use of which quickly becomes tedious when expressing simple
>>> things like
>>>      (apply append stx))
>
>> That particular example can be written very succintly with pattern
>> matching:
>
> Certainly.  But consider instead something like
>
>    (apply lset-union literal-identifier=? syntax-list-of-syntax-lists)
>
> where lset-union is from SRFI-1.  Here you would be forced to do the
> conversions as above.

Yes. Fortunately it is not hard to see how.

> Even worse, say we have an s-expression library with a procedure
>
>   (sexpr-map f x)
>
> that applies f elementwise to non-pairs in x - maybe, to make it
> nontrivial, efficiently avoiding cycles.  In order to reuse sexpr-map to
> an opaque syntax object, we would have no choice but to walk the whole
> object first to convert it to an s-expression, basically defeating the
> purpose of using sexp-map in the first place.

You are in luck - the R5RS forbids recursive syntax :-)

Apropos recursive syntax, I just *have* to mention Queinnec's
"Compiling Syntactically Recursive Programs",
<http://www-spi.lip6.fr/~queinnec/Papers/synrec.ps.gz>

--
Jens Axel Søgaard