> On Oct 24, 2016, at 9:58 AM, Matthias Felleisen <matth...@ccs.neu.edu> > wrote: > > This is an interesting class of errors. As Dimitry says, you might > be able to leave behind enough source code info when you generate > that code, so that it looks like > > (define foo (if (empty? blah) (error ‘source-name “got ‘(), expected > non-empty-list) (first blah)) > > BUT, in reality this suggests that we should help DSL designers > generate a run-time system specialized to their surface DSL needs. > Interesting — Matthias
This is not a general solution, but depending on the specific case in question, the expr/c syntax class from syntax/parse (or wrap-expr/c from syntax/contract) can help to add runtime verification via the same mechanism that performs static syntax verification. This will properly attach source location information to the contract error, but it sometimes gets the blame wrong (see https://github.com/racket/racket/issues/1412 for more info). Alexis -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.