Re: [Scheme-reports] 'else' auxiliary syntax Per Bothner (17 Oct 2014 17:07 UTC)
Re: [Scheme-reports] 'else' auxiliary syntax John Cowan (17 Oct 2014 17:33 UTC)
Re: [Scheme-reports] 'else' auxiliary syntax Peter Bex (17 Oct 2014 19:26 UTC)
Re: [Scheme-reports] 'else' auxiliary syntax John Cowan (18 Oct 2014 00:57 UTC)
Re: [Scheme-reports] 'else' auxiliary syntax Per Bothner (18 Oct 2014 07:03 UTC)
Re: [Scheme-reports] 'else' auxiliary syntax John Cowan (19 Oct 2014 01:42 UTC)
Re: [Scheme-reports] 'else' auxiliary syntax Alex Shinn (20 Oct 2014 04:06 UTC)
Re: [Scheme-reports] 'else' auxiliary syntax Alex Shinn (05 Nov 2014 13:50 UTC)
Re: [Scheme-reports] 'else' auxiliary syntax John Cowan (06 Nov 2014 02:29 UTC)

Re: [Scheme-reports] 'else' auxiliary syntax Peter Bex 17 Oct 2014 19:19 UTC

On Fri, Oct 17, 2014 at 01:29:53PM -0400, John Cowan wrote:
> Per Bothner scripsit:
>
> > Is the following reasonable (for r7rs)?
> >
> > (define-syntax else
> >    (syntax-rules ()
> >      ((_ . rest)
> >       (syntax-error "invalid use of 'else"))))
>
> That's a good definition, yes.  It's also fine for R5RS, since R5RS leaves
> the question of binding open.

Are you sure?  It doesn't mention that else is anything else than a
special thing inside cond or case.  It also mentions that macro
definitions shadow variable bindings.

If I understand correctly, that means that this program should
not fail, but simply print "1":

(define (else) 1)
(display (else))
(newline)

Even if there's a peculiar way in which you can read R5RS that allows
"else" to be bound as syntax, I doubt you'll be able to find an
implementation in which the program above will fail.  It would be a
shame if r7rs broke compatibility with these programs.

Cheers,
Peter
--
http://www.more-magic.net

_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports