On Sep 12, 2009, at 1:06 PM, Joe Marshall wrote: > Ugly, but effective: > > (define-syntax syntax-error > (syntax-rules () > ((syntax-error) (syntax-error "Bad use of syntax error!")))) > > Now write calls to (syntax-error "Duplicate binding.") and you'll > get expansion time errors that look something like this > > error: no matching clause in (syntax-error "Duplicate binding.") > > Depending on how the implementation reports these things, of course. > > Yes, it is ugly and crude, but it works.
Indeed it does. But I'd rather have it as a primitive syntax in the language, so that the implementation can do something nice with it if possible. For instance, I should be able to pass other pattern variables to `syntax-error', and have the implementation sensibly report source location for where the identifiers in those pattern variables came from, if it supports this kind of information. -- Brian Mastenbrook [email protected] http://brian.mastenbrook.net/ _______________________________________________ r6rs-discuss mailing list [email protected] http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss
