On 2009-12-04, at 09:46, Eduardo Cavazos wrote:
> Hello,
>
> I'm not a fan of the R6RS change to make brackets work like parenthesis.
> On the other hand, I respect that alot of folks like to use them this
> way. It would be nice if they were "programmable". One approach is to
> have the reader expand '[...]' into:
>
> (brackets ...)
>
> and '{...}' into:
>
> (braces ...)
>
> or something along those lines. 'bracket' and 'braces' would be macros
> that should be imported into the library accordingly. I.e. the R6RS
> standard libraries would export a 'brackets' macro that simply expands
> into '(...)'.
>
> What other designs are out there to consider?
I'd much rather see programmable readtables, which, IIRC, would be moderately
difficult to add to Ikarus (and, in any case, wouldn't be portable elsewhere).
I'm very happy with R6RS's definition of square brackets, but both braces and
guillemets, among other paired symbols, would be nice to define. But a
programmable
readtable lets us do a lot more.
My current favorite example comes from the IEEE 754-2008 decimal arithmetic
package at speleotrove.com (and found in some C compilers). I have a very crude
interface to this running, but it requires me to specify a decimal constant as
(decimal "3.14") (which is pretty much the same as the way you specify decimal
numbers in Python, modulo a left parenthesis being moved). It would be very nice
to be able to say #m3.14!
I don't think this is an easy change to make to the language either, as there
are
interactions with both libraries and ports (what does it mean to import a
readmacro?
how do we associate readtables with ports?). But maybe it's worthwhile, or
maybe
it's a feature piled on a feature...
-- v