[Larceny-users] read-dispatch-vec initialization

Felix Klock felixluser at pnkfx.org
Wed Apr 25 10:31:24 EDT 2007


On Apr 25, 2007, at 9:48 AM, Eduardo Cavazos wrote:

> Hello,
>
> I'm not a Larceny or Scheme expert...
>
> In Lib/Common/reader.scm :
>
> (letrec
>     (...
>      (read-dispatch-vec (make-vector 256 (undefined)))
>      ...)
>
>   ;; initialize read-dispatch-vec :
>
>   (do ((i 255 (- i 1)))
>        ((< i 0) '())
>     (vector-set! read-dispatch-vec i read-illegal))
>   ...)
>
> Why isn't it simply:
>
> (read-dispatch-vec (make-vector 256 read-illegal))

That change alone wouldn't work, because read-illegal is out of scope  
at the let-binding for read-dispatch-vec.

Skimming over the file, it seems like it might be reasonable to  
further refactor the code (moving the binding for read-illegal up  
above the binding for read-dispatch-vec).  But even then we get into  
questions of how best to organize the code to make it understandable  
to the reader. . .

In any case, I think we're planning to abandon this reader code in  
favor of something automatically generated from a more abstract  
specification, so worrying about these sorts of details in the short  
term is probably not worthwhile.

-Felix




More information about the Larceny-users mailing list