[plt-dev] some Racket proposals & implementation

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Fri Apr 2 18:19:51 EDT 2010

At Fri, 02 Apr 2010 16:00:08 -0600, Jon Rafkind wrote:
> Language-Specific Run-Time Configuration
> > ----------------------------------------
> >
> > Proposal: The main language of a program should determine a run-time
> > configuration, including the style for printing values.
> > ...
> > The different `define-struct's are easily support through different
> > bindings imported by `scheme' and `racket'. Similarly, for printing
> > top-level results in a module, you might imagine that `scheme' and
> > `racket' use different printing functions. The different error formats,
> > however, are not so easily controlled through bindings.
> >
> >    
> 
> It seems more elegant to me for error formats to be controlled via 
> bindings. What difficulties arise in doing so?
> 
> I mean, can't the error functions do something like
> 
> (define (error . v)
>     (parameterize ([quase-quote #t])
>       ...))

The initial error-producing examples called `+', not `error'. If you
want to vary the value-printing format by binding, then you'd need N
versions of every function for N value-printing formats.

Also, in the "s.ss" and "r.rkt" example, I think it's a feature to have
the error messages produced by `s-bad' or `r-bad' to depend on the main
language of the program, and not the language in which `r-bad' and
`s-bad' happen to be implemented.



Posted on the dev mailing list.