guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Per-module reader, take #2


From: Ludovic Courtès
Subject: Re: [PATCH] Per-module reader, take #2
Date: Thu, 20 Oct 2005 09:59:44 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux)

Hi,

Kevin Ryde <address@hidden> 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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]