all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Philipp Stephani <p.stephani2@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: JSON->lisp Mapping: Hash vs AList
Date: Sat, 16 Dec 2017 22:38:53 +0000	[thread overview]
Message-ID: <CAArVCkQzyau3E9VVxOKeturkDXKAdpBnBNqEEsBuP-P4NVwGXQ@mail.gmail.com> (raw)
In-Reply-To: <jwv1sjujoda.fsf-monnier+gmane.emacs.devel@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 895 bytes --]

Stefan Monnier <monnier@iro.umontreal.ca> schrieb am Sa., 16. Dez. 2017 um
23:36 Uhr:

> > -@defun json-parse-string string
> > +@defun json-parse-string string &key (object-type 'hash-table)
>
> Emacs generally avoids keyword arguments.
>
> I consider them acceptable only for macros (where the cost of parsing
> arguments is acceptable since it's done at compile time) or for
> function which both need many optional arguments (so positional
> arguments are unwieldy) and whose runtime is significant enough that
> parsing keyword arguments is a non-issue (e.g. make-process).
>
> Given that there's only one optional argument here, I'd rather have it
> be a &optional one.
>
>
I don't like optional arguments. They make the call sites less readable,
because it becomes less clear what the meaning of an argument is.
I don't care about saving a few nanoseconds; that's premature optimization.

[-- Attachment #2: Type: text/html, Size: 1271 bytes --]

  reply	other threads:[~2017-12-16 22:38 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
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 [this message]
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=CAArVCkQzyau3E9VVxOKeturkDXKAdpBnBNqEEsBuP-P4NVwGXQ@mail.gmail.com \
    --to=p.stephani2@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.