[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: suggestion: a shorter convenience form

Jens Axel Søgaard wrote:
My point was that

    Refering to the original piece of syntax is often neccessary in
    order to give error messages in terms of user written syntax.

so in that context it is relevant.

I agree.

>Per Bothner wrote:
Note also that if you *do* want syntax-error, it might be better to
report error location more specifically that the entire cond.

For misuses like (cond) and (cond 1) it makes sense to report the
entire macro call.

That is easy, since define-syntax-case allows a fall-back case:

(define-syntax-case cond ()
  ((_ c1 c2 ...) ...)
  (x (syntax-error "cond has invalid clause list" #'x)))

For other errors I'd want the error attached to a specific clause:

  (syntax-case c1 (=>)
    [ce (syntax-error "cond has invalid clause" c1)])

Then the error message refers to the specific clause.
	--Per Bothner
per@xxxxxxxxxxx   http://per.bothner.com/