guile-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Make `get-datum' conform more closely to R6RS semantics


From: Ludovic Courtès
Subject: Re: [PATCH] Make `get-datum' conform more closely to R6RS semantics
Date: Mon, 05 Nov 2012 18:52:42 +0100
User-agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux)

Hello!

Mark H Weaver <address@hidden> skribis:

> The problem with the approach above is that it sets the read options
> globally, which is obviously a bad idea in a multithreaded program.
>
> Until very recently there was no other practical option, but now 'read'
> starts by building a private struct 'scm_t_read_opts' and passes it down
> to all the helper functions explicitly. 

Yep, it’s good to see that this work is already beneficial to other
areas.  :-)

> I've been avoiding adding a public API for this, because I feel that the
> current 'read-options' API is poorly-designed and I'd rather take the
> opportunity to come up with a clean design.

What about just mapping the existing ‘read-options’ to something like:

  (set-port-read-options! PORT OPTIONS)

where OPTIONS would be a list of symbols, as for ‘read-options’?  This
seems to me like the obvious API extension, but maybe I’m overlooking
something.

> For now, I suggest that we add 'get-datum' as a C function in read.c,
> which initializes the 'scm_t_read_opts' as needed for R6RS.

Yes, there’s still this possibility if the above one doesn’t work.

Thanks,
Ludo’.




reply via email to

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