On Fri, 2009-12-04 at 19:44 -0800, Vincent Manis wrote:
> On 2009-12-04, at 19:36, Derick Eddington wrote:
> 
> > On Fri, 2009-12-04 at 19:27 -0800, Derick Eddington wrote:
> >> I bet #!identifier could be used somehow.
> > 
> > I meant #!symbol.  (I've been calling it #!identifier but I just started
> > thinking #!symbol is better.)
> 
> I quite like this approach; I had forgotten about it. It's certainly pretty 
> easy to 
> implement. I don't know how it would mesh with libraries: taking my decimal 
> numbers 
> example, I'd like to be able to say 
> 
>   (import (ieee-754-decimal))
>   #!ieee-754-decimal-numbers
>   ... #m3.14 ...
> 
> but this seems to involve some kind of odd interaction between importing a 
> library 
> and the port where we're reading code from. In virtually any kind of Scheme 
> evaluator
> I can imagine, the importing is done in the evaluator's stomach, while the 
> reading 
> happens in its mouth (digestive analogy ripped from TeX). This feature 
> suggests
> a flow in the reverse direction, which is not a very nice thought :)
> 
> Still, I wonder if it can be tamed. Sounds promising!

Here's an idea:

read encounters an unknown #!symbol.  SRFI XXX says to try to find a
handler associated with #!symbol's in a library named 
`(srfi xxx extension ,symbol).  read does 
(eval 'handler (environment `(srfi xxx extension ,symbol)))
to get the handler at read time.

With SRFI 103, users can "overlay" their `(srfi xxx extension ,symbol)
libraries by putting such libraries' files in a search path other than
where the primary (srfi ---) libraries are, which seems good for
organization and also may be necessary because of file system
permissions.

-- 
: Derick
----------------------------------------------------------------

Reply via email to