unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: guile-devel@gnu.org
Subject: Re: [PATCH] Make `get-datum' conform more closely to R6RS semantics
Date: Mon, 05 Nov 2012 18:52:42 +0100	[thread overview]
Message-ID: <87625kuec5.fsf@gnu.org> (raw)
In-Reply-To: 87objceixe.fsf@tines.lan

Hello!

Mark H Weaver <mhw@netris.org> 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	other threads:[~2012-11-05 17:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-04 23:59 [PATCH] Make `get-datum' conform more closely to R6RS semantics Andreas Rottmann
2012-11-05  5:07 ` Mark H Weaver
2012-11-05 17:52   ` Ludovic Courtès [this message]
2012-11-06  7:36     ` Improving the API for read options Mark H Weaver
2012-11-06 19:01       ` Ludovic Courtès
2012-11-11  7:56         ` Mark H Weaver
2012-11-06 19:55   ` [PATCH] Make `get-datum' conform more closely to R6RS semantics Andreas Rottmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87625kuec5.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).