Hi,

Kevin Ryde <[EMAIL PROTECTED]> writes:

> I think that may be possible already using current-load-port.
> Something like
>
>       (define-module (foo bar)
>         ...)
>       (my-zany-reader)
>
> where `my-zany-reader' reads and parses from current-load-port and
> does whatever with the results, like make new defines presumably.
>
> This could be used for the entire rest of the file, or stop at some
> point like a "here-document" perhaps.

This looks quite hackish, indeed.  And what exactly would happen to
`primitive-load' (which is the one that triggered the call to
`my-zany-reader') when `my-zany-reader' returns?  If everything works
fine, then the file offset of `current-load-port' will now point to
where `my-zany-reader' finished its job.  That's relying too much on
side-effects.

> Wouldn't be compiler-friendly, but I wouldn't worry about that until
> there's an actual compiler to be friendly with :-).

Well, keep in mind that Keishude's Guile-VM is not that far from
usable.  So far, I only ported it to 1.7 and started using it and
documenting it.  There are certainly still bugs but it's worth putting
some efforts in it.  I hope I'll be able to release something in the
foreseeable future.

> `load' is pretty simple, isn't it?  One can make a new open/read/eval
> without too much trouble.  I guess there's bits like path searching
> and current module saving.  Maybe they only need to be better
> documented though.

Yes, they probably do need to be better documented.  ;-)

Thanks,
Ludovic.


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel

Reply via email to