emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: JSON->lisp Mapping: Hash vs AList


From: Philipp Stephani
Subject: Re: JSON->lisp Mapping: Hash vs AList
Date: Sat, 16 Dec 2017 22:38:53 +0000



Stefan Monnier <address@hidden> schrieb am Sa., 16. Dez. 2017 um 23:36 Uhr:
> address@hidden json-parse-string string
> address@hidden 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. 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]