From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7791 invoked by alias); 19 Jan 2014 14:46:50 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 7778 invoked by uid 89); 19 Jan 2014 14:46:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: hera.aquilenet.fr Received: from hera.aquilenet.fr (HELO hera.aquilenet.fr) (141.255.128.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 19 Jan 2014 14:46:47 +0000 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 85E451B11; Sun, 19 Jan 2014 15:46:44 +0100 (CET) Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3pExDAD6sLry; Sun, 19 Jan 2014 15:46:44 +0100 (CET) Received: from pluto (reverse-83.fdn.fr [80.67.176.83]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 1B65A14D7; Sun, 19 Jan 2014 15:46:44 +0100 (CET) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Doug Evans Cc: Eli Zaretskii , "gdb-patches\@sourceware.org" Subject: Re: [PATCH v1 02/36] Guile extension language: doc additions References: <52b9da59.64ab440a.0b0b.7e1c@mx.google.com> <83ha9w68av.fsf@gnu.org> <87sit4kb1t.fsf@gnu.org> <8761phqaws.fsf@gnu.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 30 =?utf-8?Q?Niv=C3=B4se?= an 222 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu Date: Sun, 19 Jan 2014 14:46:00 -0000 In-Reply-To: (Doug Evans's message of "Sat, 18 Jan 2014 13:57:26 -0800") Message-ID: <87ppnom3l8.fsf@gnu.org> User-Agent: Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2014-01/txt/msg00711.txt.bz2 Doug Evans skribis: > On Sat, Jan 18, 2014 at 12:42 PM, Ludovic Court=C3=A8s wro= te: >> Doug Evans skribis: >> >>> On Fri, Jan 3, 2014 at 1:30 PM, Ludovic Court=C3=A8s wro= te: >>>>>> +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{"re= place"} >>>>>> +corresponds to Guile's @code{SCM_FAILED_CONVERSION_QUESTION_MARK}. >>>>> >>>>> Suggest a cross-reference to Guile documentation here. >>>> >>>> Agreed. Also, Guile talks of =E2=80=9Cconversion strategy=E2=80=9D an= d =E2=80=9Cconversion >>>> error handler=E2=80=9D, with values =E2=80=98error=E2=80=99, =E2=80=98= substitute=E2=80=99, and =E2=80=98escape=E2=80=99 (at the >>>> Scheme level), and I=E2=80=99d recommend sticking to those names and t= erminology. >>> >>> 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=E2=80=99d 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=E2=80=99s API (notably and =E2=80=98string->bytevector=E2= =80=99, =E2=80=98set-port-conversion-strategy!=E2=80=99.) >> (value->string foo #:conversion-strategy 'error) >> >> So that has to be converted in C but I think that=E2=80=99s 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 =E2=80=98value->string=E2=80=99 could have this signature: value->string VAL [ENCODING [ERRORS]] The precedent being =E2=80=98string->pointer=E2=80=99 and =E2=80=98string->= bytevector=E2=80=99. > We can create a 'error symbol at start up and just use scm_eq so the > comparison is easy enough. Exactly, that=E2=80=99s what I would suggest. Thanks, Ludo=E2=80=99.