[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Scheme-reports] (dynamic) lexical extensions
Daniel Villeneuve scripsit:
> Well, as for #,(foo 2012-05-11), #foo 2012-05-11 implies that the
> reader scan and tokenize 2012-05-11 before passing it to the "foo"
> (or "lexical-foo") macro handler.
Yes, you'd need #,(foo "2012-05-11) or under my proposal #foo"2012-05-11".
> I don't see how dates, for example,
> could be made to look like first-class objects with this approach.
It depends on how you think of it. Does #(foo bar baz) or #u8(12 20 42)
look first-class to you?
> Also, the "only works in code" part breaks the property that code is
> a subset of data (unlike the lexcial extensions I am using).
That's true. You can't have everything.
> Since the number of extensions used over the past years has been
> quite limited (mainly: dates, times, XML fragments), maybe the
> easiest way to correctly integrate these with libraries and
> environments is to forget about the dynamic nature of this
> experiment and bury the useful extensions in the core interpreter
> (as with extensions about admissible symbols, for instance).
That's reasonable. Over the whole of Scheme, there are a *lot* of
lexical syntax extensions that have been used at one time or another:
square brackets, the syntax-case extensions #' #` #, #,@, #s8 #u16
#s16 etc. for specialized vectors, #nA for n-dimensional arrays, #*
for bitstrings, #: and : (prefix or postfix) for keywords, #+ and #-
for read-time conditionalization, #, for SRFI-10, DSSSL extended lambda
syntax, #!eof to fake an EOF object, #& for initialized boxes, #" for
strings allowing interpolation, #r for arbitrary number radices, #[
for records, ....
You escaped them by the will-death John Cowan
and the Way of the Black Wheel. cowan@x
I could not. --Great-Souled Sam http://www.ccil.org/~cowan
Scheme-reports mailing list