From: Eli Zaretskii <eliz@gnu.org>
To: Philipp Stephani <p.stephani2@gmail.com>
Cc: emacs-devel@gnu.org, raman@google.com
Subject: Re: JSON->lisp Mapping: Hash vs AList
Date: Sun, 17 Dec 2017 22:07:23 +0200 [thread overview]
Message-ID: <834lopqft0.fsf@gnu.org> (raw)
In-Reply-To: <CAArVCkQhTv3o-V53PBKGxwrWfdXCYW5NDbb_zSZ7v95Dw8QraQ@mail.gmail.com> (message from Philipp Stephani on Sun, 17 Dec 2017 17:44:34 +0000)
> From: Philipp Stephani <p.stephani2@gmail.com>
> Date: Sun, 17 Dec 2017 17:44:34 +0000
> Cc: raman@google.com, emacs-devel@gnu.org
>
> > > -@defun json-parse-string string
> > > +@defun json-parse-string string &key (object-type 'hash-table)
> >
> > Hmm.. why is there an apostrophe before "hash-table"? What do you
> > want to get in the output there?
> >
> > An apostrophe? It seems to work as expected.
>
> That's not what I meant. I meant we never use a bare apostrophe in
> Texinfo, we use markup instead. So I asked what you want to get there
> in the Info and printed output, so I could suggest a proper markup.
>
> My goal was to specify the default value the same way that cl-lib does. With cl-lib you'd write the function as
>
> (cl-defun json-parse-string (string &key (object-type 'hash-table)))
>
> We can't do that in C, but we can keep the same syntax.
We are miscommunicating. I'm talking about Texinfo markup, not about
Lisp or C code. In Texinfo manuals dedicated to Emacs we use
@code{foo} where in Lisp you'd write 'foo. Why not in this case?
IOW, why not use
@defun json-parse-string string &key (object-type @code{hash-table})
?
> > > +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.
next prev parent reply other threads:[~2017-12-17 20:07 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-12 1:39 JSON->lisp Mapping: Hash vs AList raman
2017-12-12 13:08 ` Nicolas Petton
2017-12-12 15:52 ` raman
2017-12-13 22:37 ` Philipp Stephani
2017-12-14 0:00 ` T.V Raman
2017-12-14 16:27 ` Eli Zaretskii
2017-12-16 22:24 ` Philipp Stephani
2017-12-17 15:53 ` Eli Zaretskii
2017-12-17 17:44 ` Philipp Stephani
2017-12-17 20:07 ` Eli Zaretskii [this message]
2017-12-18 19:55 ` Philipp Stephani
2017-12-18 20:19 ` Eli Zaretskii
2017-12-18 20:59 ` Philipp Stephani
2017-12-19 3:50 ` Vibhav Pant
2017-12-19 17:49 ` Philipp Stephani
2017-12-19 17:08 ` Eli Zaretskii
2017-12-19 17:22 ` Philipp Stephani
2017-12-18 16:15 ` Clément Pit-Claudel
2017-12-19 17:50 ` Philipp Stephani
2017-12-15 4:13 ` Vibhav Pant
2017-12-16 22:25 ` Philipp Stephani
2017-12-18 20:26 ` [PATCH] Accept alists when serializing JSON Philipp Stephani
2017-12-20 5:58 ` Vibhav Pant
2017-12-22 13:55 ` Philipp Stephani
2017-12-24 17:16 ` Vibhav Pant
2017-12-26 20:46 ` Philipp Stephani
2017-12-24 13:00 ` Philipp Stephani
2017-12-16 22:34 ` JSON->lisp Mapping: Hash vs AList Stefan Monnier
2017-12-16 22:38 ` Philipp Stephani
2017-12-17 0:54 ` Paul Eggert
2017-12-17 2:41 ` Stefan Monnier
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=834lopqft0.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=p.stephani2@gmail.com \
--cc=raman@google.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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.