public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Doug Evans <xdje42@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>,
	 "gdb-patches\@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH v1 02/36] Guile extension language: doc additions
Date: Sun, 19 Jan 2014 14:46:00 -0000	[thread overview]
Message-ID: <87ppnom3l8.fsf@gnu.org> (raw)
In-Reply-To: <CAP9bCMSO5mdjCEFsrpKq4nZFaaqadeWT-MOWU2ZfL5z0cL2ogg@mail.gmail.com>	(Doug Evans's message of "Sat, 18 Jan 2014 13:57:26 -0800")

Doug Evans <xdje42@gmail.com> skribis:

> On Sat, Jan 18, 2014 at 12:42 PM, Ludovic Courtès <ludo@gnu.org> wrote:
>> Doug Evans <xdje42@gmail.com> skribis:
>>
>>> On Fri, Jan 3, 2014 at 1:30 PM, Ludovic Courtès <ludo@gnu.org> wrote:
>>>>>> +The optional @var{errors} argument is either @code{"strict"}
>>>>>> +or @code{"replace"}.  A value of @code{"strict"} corresponds to
>>>>>> +Guile's @code{SCM_FAILED_CONVERSION_ERROR} and a value of @code{"replace"}
>>>>>> +corresponds to Guile's @code{SCM_FAILED_CONVERSION_QUESTION_MARK}.
>>>>>
>>>>> Suggest a cross-reference to Guile documentation here.
>>>>
>>>> Agreed.  Also, Guile talks of “conversion strategy” and “conversion
>>>> error handler”, with values ‘error’, ‘substitute’, and ‘escape’ (at the
>>>> Scheme level), and I’d recommend sticking to those names and terminology.
>>>
>>> The values chosen were to be consistent with the python support.
>>> OTOH I *do* like being more consistent with the particular extension
>>> language at hand.
>>> I've tentatively changes things to use "error" and "substitute".
>>> Question: How about exporting the SCM_FAILED_CONVERSION_* constants
>>> and using those instead?
>>>
>>> E.g, (value->string foo #:errors SCM_FAILED_CONVERSION_ERROR) ?
>>
>> I’d rather use a symbol:
>
> Yeah, I thought of that, but the encoding is a string,
> so it'd be "#:encoding string #:errors symbol".

Right.  Looks good to me.

> I don't have a strong preference, but using a symbol here while
> feeling Schemey feels too weird.
> It's not a strong preference though.

Using a symbol for #:errors?  It would be natural and consistent with
the rest of Guile’s API (notably and ‘string->bytevector’,
‘set-port-conversion-strategy!’.)

>>   (value->string foo #:conversion-strategy 'error)
>>
>> So that has to be converted in C but I think that’s OK.
>
> #:conversion-strategy is more to type than #:errors but I'm happy to
> change it if you want.
> Though this is a case where I would not want to support both
> #:conversion-strategy and #:errors so whatever we pick is it.

Right.  Or ‘value->string’ could have this signature:

  value->string VAL [ENCODING [ERRORS]]

The precedent being ‘string->pointer’ and ‘string->bytevector’.

> We can create a 'error symbol at start up and just use scm_eq so the
> comparison is easy enough.

Exactly, that’s what I would suggest.

Thanks,
Ludo’.

  reply	other threads:[~2014-01-19 14:46 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-24 19:03 Doug Evans
2013-12-25 19:27 ` Eli Zaretskii
2014-01-03 21:31   ` Ludovic Courtès
2014-01-04  7:12     ` Eli Zaretskii
2014-01-04 11:57       ` Ludovic Courtès
2014-01-04 14:41         ` Eli Zaretskii
2014-01-04 17:42           ` Ludovic Courtès
2014-01-04 20:00             ` Eli Zaretskii
2014-01-16  4:20               ` Doug Evans
2014-01-18 20:36         ` Doug Evans
2014-01-18 20:52           ` Ludovic Courtès
2014-01-18 20:55             ` Doug Evans
2014-01-19 16:58               ` Eli Zaretskii
2014-01-19 17:19                 ` Doug Evans
2014-01-19 17:34                   ` Eli Zaretskii
2014-01-19 17:53                     ` Doug Evans
2014-01-19 18:10                       ` Eli Zaretskii
2014-01-19 21:19                         ` Doug Evans
2014-01-18 20:16     ` Doug Evans
2014-01-18 20:42       ` Ludovic Courtès
2014-01-18 21:57         ` Doug Evans
2014-01-19 14:46           ` Ludovic Courtès [this message]
2014-01-19 21:37             ` Doug Evans
2014-01-19 22:50               ` Ludovic Courtès
2014-01-18 22:32     ` Doug Evans
2014-01-19 14:47       ` Ludovic Courtès
2014-01-19 15:56         ` Eli Zaretskii
2014-01-19 16:13           ` Ludovic Courtès
2014-01-19 17:05             ` Doug Evans
2014-01-18 20:06   ` Doug Evans
2014-01-18 20:24     ` Eli Zaretskii
2014-01-18 20:53       ` Doug Evans
2014-01-19 16:57         ` Eli Zaretskii
2014-01-19 17:42           ` Doug Evans
2014-01-19 21:01           ` Doug Evans

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

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

  git send-email \
    --in-reply-to=87ppnom3l8.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=xdje42@gmail.com \
    /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).