From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Accept plists when serializing and parsing JSON Date: Wed, 30 May 2018 09:58:05 +0100 Message-ID: <87in75bjvm.fsf@gmail.com> References: <87sh6awls5.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1527670609 5917 195.159.176.226 (30 May 2018 08:56:49 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 30 May 2018 08:56:49 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Philipp Stephani , Emacs developers To: Yuri Khan Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 30 10:56:45 2018 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 1fNwuS-0001RP-VE for ged-emacs-devel@m.gmane.org; Wed, 30 May 2018 10:56:45 +0200 Original-Received: from localhost ([::1]:37049 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNwwY-0004DA-Bp for ged-emacs-devel@m.gmane.org; Wed, 30 May 2018 04:58:54 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58350) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNwvv-0004Cp-Jh for emacs-devel@gnu.org; Wed, 30 May 2018 04:58:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fNwvr-0008Eg-Nj for emacs-devel@gnu.org; Wed, 30 May 2018 04:58:15 -0400 Original-Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]:33352) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fNwvr-0008EX-GM for emacs-devel@gnu.org; Wed, 30 May 2018 04:58:11 -0400 Original-Received: by mail-wr0-x244.google.com with SMTP id k16-v6so1428513wro.0 for ; Wed, 30 May 2018 01:58:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=WaKvSxyaPxAJmTTNZq8vy3vXwntRQ+lP+63TbOO7GTo=; b=rMZnS+9WEpkDhwQgXx5uTvuaAeiptY1Ilzt52aAY4tRR1oi8Y9yxWZ75wVpudUiR+I 57sVObFdIaJd/LAqSCvZkhBY2fvG474c0YggwK8Oa5bABwfx3B1RT30K8BzadiVPLAcn rZJ9slrKxLO/fC4HUslXujPdcP62YHLKrSsPRm6EO7cZba3n6iLj8w1RBW6Oozq+hE9D CZ8wf27oAkBc6uIFCWtVAI5wXrPazXWRJKtVUTuI7lQL34qccpwCR670WrgAhuIArUr4 uKz728b6MljPjPr6EQTLcaFZwIm6HjewbQjwreYFOMb43V8iY6j+kkS7yh4Fn4uz9aox WXfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=WaKvSxyaPxAJmTTNZq8vy3vXwntRQ+lP+63TbOO7GTo=; b=GHIxY21Z20UyYdOl67U6QQGPVs1RlnZTDMzV14WFSN+/AMYEIsERtO41GHtLXvhgqj 3/jYdB4eg7PikILgg/PqWhXuN1Ds7ZtNgdymOdE+kJv/8pAfuptbJeC2Oi3VCS7A6wpw QwN35yLPk0Tdh0eIATZgqYurzGIuXUObIRt/Tee1Z3isHbL0R2OaoTG69/Z7ENdc/Jvh OVoIbfk83RVtBm8/a6Yl13NandhGbnQsbHKQQDsXtIRXkbgK7o44W6h5qirbbRHpXOH/ lByUfILzoP9vSj5KBxLKgYRbM4xk6vWQfgzBKw5dI8ailILaeF7mzUgw8156SJpBYFgx BY+g== X-Gm-Message-State: ALKqPwfzz2394qA4oE/O0XrEoU4gJLA52U3md8EK4vLLmqM8qyAROIwQ 9IQw76zsBUcfABzoXsMUfZYbX6c9 X-Google-Smtp-Source: ADUXVKIfGOBOxXcS3mRqsojbrkVcchNUhP9cNO/mxbSCsItNB2EQeXWhTzrZkxBzg/X0F3ygb6Istw== X-Received: by 2002:adf:9b11:: with SMTP id b17-v6mr1389055wrc.206.1527670689721; Wed, 30 May 2018 01:58:09 -0700 (PDT) Original-Received: from lolita.yourcompany.com (188.139.62.94.rev.vodafone.pt. [94.62.139.188]) by smtp.gmail.com with ESMTPSA id o16-v6sm16629918wri.67.2018.05.30.01.58.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 May 2018 01:58:08 -0700 (PDT) In-Reply-To: (Yuri Khan's message of "Wed, 30 May 2018 13:37:28 +0700") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::244 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:225820 Archived-At: Yuri Khan writes: > On Wed, May 30, 2018 at 5:31 AM Jo=C3=A3o T=C3=A1vora wrote: > >> Well, it's not really "global state" in the sense I believe you're >> talking about, because no part of the library is maintaining any state in >> global variables -- it's read-only from json.c. > after ironing out all [the other?] bugs related to shared state Which ones? Those seem to be precisely the ones I meant to say are excluded because the var is read-only. > * =E2=80=98foo=E2=80=99 wants plists while =E2=80=98bar=E2=80=99 wants al= ists. If "want" is the same thing as "must have", then bar should be setting the var from the beginning, end of story. It should only not set the var if it doesn't care. There are many variables like this in emacs. Eli recently reminded me in a closely related thread I have to bind coding-system-for-write around process-send-string, for example. Obviously, the pitfall is overlooking to bind them when you have to. Presumably this is outweighed by the convenience of not passing a trillion args to a function call and, more importantly, to every caller of a function, like in the commit that removes the var, which is quite a bit more complex (which is why I started with the other alternative). Anyway, this point could be irrelevant if we remove the variable and argument completely, auto-detecting plists. Can't decide if that could be a worse idea, though. Jo=C3=A3o