[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Improved source properties and errors; => within case
From: |
Andy Wingo |
Subject: |
Re: [PATCH] Improved source properties and errors; => within case |
Date: |
Wed, 08 Feb 2012 11:06:08 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) |
Heya Mark,
Patch set looks good to me. Please push. One comment:
On Wed 08 Feb 2012 10:09, Mark H Weaver <address@hidden> writes:
> The way that source properties are stored means that Guile can only
> -associate source properties with parenthesized expressions, and not, for
> -example, with individual symbols, numbers or strings. The difference
> -can be seen by typing @code{(xxx)} and @code{xxx} at the Guile prompt
> -(where the variable @code{xxx} has not been defined):
> +associate source properties with parenthesized expressions and non-empty
> +strings, and not, for example, with individual symbols or numbers. The
> +difference can be seen by typing @code{(xxx)} and @code{xxx} at the
> +Guile prompt (where the variable @code{xxx} has not been defined):
This isn't quite right; #*101010101 should probably get source info, no?
And is it useful to have an exception for empty strings? I would think
that it would be fine to return fresh empty strings. The compiler would
DTRT. I don't care much though.
Perhaps: "Everything but numbers, symbols, characters, and booleans get
source information." Dunno.
> + (syntax-case whole-expr ()
> + ((_ clause clauses ...)
> + #`(begin
(This is in `cond'). Why is the begin needed here?
> + #`((let ((t test))
> + (if t t #,@tail)))))
Use `or' here.
> + (syntax-case whole-expr ()
> + ((_ expr clause clauses ...)
> + (with-syntax ((key #'key))
> + #`(let ((key expr))
> + #,@(fold
(In `case'.) Likewise here, it would be good to avoid this use of an
implicit `begin', of possible.
> + (if (memv datum seen)
> + (warn-datum 'duplicate-case-datum))
> + (if (or (pair? datum)
> + (array? datum)
> + (generalized-vector? datum))
> + (warn-datum 'bad-case-datum))
Nice.
Cheers,
Andy
--
http://wingolog.org/