From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: Re: JSON->lisp Mapping: Hash vs AList Date: Tue, 19 Dec 2017 17:49:00 +0000 Message-ID: References: <838te5uvee.fsf@gnu.org> <838te1qrkq.fsf@gnu.org> <834lopqft0.fsf@gnu.org> <83k1xjpz5a.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a114c563e92c7910560b515a2" X-Trace: blaine.gmane.org 1513705774 18229 195.159.176.226 (19 Dec 2017 17:49:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 19 Dec 2017 17:49:34 +0000 (UTC) Cc: Eli Zaretskii , TV Raman , emacs-devel@gnu.org To: Vibhav Pant Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 19 18:49:29 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eRM1A-0004Rz-UJ for ged-emacs-devel@m.gmane.org; Tue, 19 Dec 2017 18:49:29 +0100 Original-Received: from localhost ([::1]:57091 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRM39-0005zl-8n for ged-emacs-devel@m.gmane.org; Tue, 19 Dec 2017 12:51:31 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46316) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRM0w-0004CO-DO for emacs-devel@gnu.org; Tue, 19 Dec 2017 12:49:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRM0v-0003gr-A1 for emacs-devel@gnu.org; Tue, 19 Dec 2017 12:49:14 -0500 Original-Received: from mail-qk0-x233.google.com ([2607:f8b0:400d:c09::233]:34945) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eRM0t-0003fl-ND; Tue, 19 Dec 2017 12:49:11 -0500 Original-Received: by mail-qk0-x233.google.com with SMTP id 143so8817391qki.2; Tue, 19 Dec 2017 09:49:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qmGbDnF0BFzVipcOtGgAaG65mW5fsDjB64iw2Y15qTg=; b=rVtwfDtWa/QQRjos0S46m8vYNL2C2I/jQd06xvTYpBJ0Lfk0WvgLFI9Oos1ebmGiHP 5cm8PwTgYSMy/7yseQnTQnvIPHRNQ80Kyd2LMHzzZWLHUNfMxKwvIV4m+U9IAT7e3RWa +24bmoq86YlcpHbMpH64IBA7gcKDds/5wbH3isr193GdXn8BXekkJW2VQZ6V0KxfPEXm U9cRPHhyEIqswRb9Sl+9Z3Rm5atIgZ5daOY2N/P2o/QbU+jHqfeFGUMEp1UOdm/tI+ND hyIV/OYqDb7GeZpIA6gq8FtJQo5BvhZmPMt7GJOg80fh1a8Q5MhkdMiHVmf1+GNKJskt fyEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qmGbDnF0BFzVipcOtGgAaG65mW5fsDjB64iw2Y15qTg=; b=XeMWC1QcSuPkoP/O35ZHl2RFxR5xw/gMRVOhiC+wI46pP0/6/AeJQAoue4vtaBqOb7 lW0vIA+YoSUSDTy8EjrkXjZSfTpZdqmXATOR/+r1wdRnnlcWqH/toMN4ZY7kCBI8W9aX 0sMTyaRiZfTJdw1dbhN5qxO2zJXi6Lm4gl2YnHUP2UDVpHdzVANV1BS17aFDGKRAxaf9 kz+IFqdT4gojGD8c4GJ7Ax0gBH8D5atAQhcseczl1PSBUDcJUu6FhknpI4wjxgFvXNAY xowZmN9kS9Khj4lhoUtTokeqtoGqwJ+xwy05vmblNMWDx4s81PLYA59cIEiHpju3sXsF 3Zpg== X-Gm-Message-State: AKGB3mJ0yQ5TSc1IxLq8HsN2nXOi2qCZrdEkTOw8KO7c1e8WFtrvnc2D NndlihawPh1nq0cbrc/mC1DcCgenP8sb4RQpqTQ= X-Google-Smtp-Source: ACJfBos6Y1psEwMJ6/2LU9cNbQPuU1g4LZPyWKyUqJ1iqz8k5Lc2okiyeJsUK+6g4L7ZfBiJoc7Drzcdze0Qd36EqzM= X-Received: by 10.55.10.7 with SMTP id 7mr5917026qkk.198.1513705750839; Tue, 19 Dec 2017 09:49:10 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::233 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:221254 Archived-At: --001a114c563e92c7910560b515a2 Content-Type: text/plain; charset="UTF-8" Vibhav Pant schrieb am Di., 19. Dez. 2017 um 04:51 Uhr: > On Tue, Dec 19, 2017 at 2:29 AM, Philipp Stephani > wrote: > > > > > > Eli Zaretskii schrieb am Mo., 18. Dez. 2017 um 21:19 Uhr: > >> > >> > > > > +The keyword argument OBJECT-TYPE specifies which Lisp type > is > >> > used to > >> > > > ^^^^^^^^^^^ > >> > > > Shouldn't that be `:object-type' (including quotes)? > >> > > > > >> > > > Depending on whether we can use &key in a docstring in core. If > >> > so, then this one is correct, see > >> > e.g. > >> > > the > >> > > > docstring of should-error. > >> > > > >> > > IMO, the doc string of should-error is no less confusing than this > >> > > one, because it expects something like ":type 'foo". > >> > > > >> > > Arguably yes. Though that has been the convention for cl-lib > >> > functions for a while. > >> > > >> > cl-lib enjoyed being in the shadows for too long. I don't think we > >> > should let that continue any longer, we should fix that. > >> > > >> > OK, what's your suggestion? > >> > >> I thought I wrote that above. > > > > > > I've attached a new version of the patch. > > fns.c has `get_key_arg', which accomplishes what json_parse_object_type is > doing > here, and allows the list of keyword arguments to be extended (like in > `make-hash-table`). Do you think that could be used here instead? > > Yes, it would be usable. Probably it should be made 'extern', and Fmake_progress should also use it. It's not a terribly big deal, though. --001a114c563e92c7910560b515a2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Vibhav= Pant <vibhavp@gmail.com> sc= hrieb am Di., 19. Dez. 2017 um 04:51=C2=A0Uhr:
On Tue, Dec 19, 2017 at 2:29 AM, Philipp Stephani <p.stephani2@gmail.com> wrote:
>
>
> Eli Zaretskii <
el= iz@gnu.org> schrieb am Mo., 18. Dez. 2017 um 21:19 Uhr:
>>
>> >=C2=A0 >=C2=A0 >=C2=A0 > +The keyword argument OBJECT= -TYPE specifies which Lisp type is
>> > used to
>> >=C2=A0 >=C2=A0 >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^^^^^^^^^^^
>> >=C2=A0 >=C2=A0 >=C2=A0 Shouldn't that be `:object-ty= pe' (including quotes)?
>> >=C2=A0 >=C2=A0 >
>> >=C2=A0 >=C2=A0 > Depending on whether we can use &ke= y in a docstring in core. If
>> > so, then this one is correct, see
>> >=C2=A0 e.g.
>> >=C2=A0 >=C2=A0 the
>> >=C2=A0 >=C2=A0 > docstring of should-error.
>> >=C2=A0 >
>> >=C2=A0 >=C2=A0 IMO, the doc string of should-error is no le= ss confusing than this
>> >=C2=A0 >=C2=A0 one, because it expects something like "= ;:type 'foo".
>> >=C2=A0 >
>> >=C2=A0 > Arguably yes. Though that has been the convention = for cl-lib
>> > functions for a while.
>> >
>> >=C2=A0 cl-lib enjoyed being in the shadows for too long.=C2=A0= I don't think we
>> >=C2=A0 should let that continue any longer, we should fix that= .
>> >
>> > OK, what's your suggestion?
>>
>> I thought I wrote that above.
>
>
> I've attached a new version of the patch.

fns.c has `get_key_arg', which accomplishes what json_parse_object_type= is doing
here, and allows the list of keyword arguments to be extended (like in
`make-hash-table`). Do you think that could be used here instead?


Yes, it would be usable. Probably it s= hould be made 'extern', and Fmake_progress should also use it.
It's not a terribly big deal, though.
--001a114c563e92c7910560b515a2--