From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 9Wy0H8hisGIO0gAAbAwnHQ (envelope-from ) for ; Mon, 20 Jun 2022 14:06:32 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id sNBWHshisGKPCQAAauVa8A (envelope-from ) for ; Mon, 20 Jun 2022 14:06:32 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D87A121A39 for ; Mon, 20 Jun 2022 14:04:44 +0200 (CEST) Received: from localhost ([::1]:40560 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3G95-0004LT-CT for larch@yhetil.org; Mon, 20 Jun 2022 08:04:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50212) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3G80-0004L6-SA for emacs-orgmode@gnu.org; Mon, 20 Jun 2022 08:03:36 -0400 Received: from mail-qv1-xf2a.google.com ([2607:f8b0:4864:20::f2a]:43548) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o3G7z-00041P-3P for emacs-orgmode@gnu.org; Mon, 20 Jun 2022 08:03:36 -0400 Received: by mail-qv1-xf2a.google.com with SMTP id y14so10237945qvs.10 for ; Mon, 20 Jun 2022 05:03:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=B7o71LLd1b5+n34tgcC2TjyHESQGQOUJOZKCNxvsFeg=; b=BngrHgQCCVd5O05foubONDkYhzhcJH0NYGEyPqJGprE3UVS9HvB1P5Ju6jA5t+PysB Qg1PQd/gn+pt6uwO9Ijhibq9F73BNhKq9OMM7V5K3t404eusOVU51CSDDTt6SbxM7STj d0+Jy1r3LELJiGiaj/QSJLThChLf1qBmEHMzL+OwP3uBhlvhZ1Hmjb6cE0KdbYUrAR66 jntDNKKVyxf1/chB9O/KpT4I4Cy24Tcvsk692nGhzhHoTKdRckKZbVf30edolfuJTh9A mJJLRohgnu8SMvUoAk1meCoXUrn/F22Bu8opOHKPe9ZI9iKfZo4YZGg259ZICptGOnB2 5Kyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=B7o71LLd1b5+n34tgcC2TjyHESQGQOUJOZKCNxvsFeg=; b=q1JS3Gvm598LtKqm3vN3accGpIU67M0VroQ08/GRO2Sh6q3ScKim5mfGpXAKzU3akO ARrrYLTB2twXQbpjeJ+bcVz98k+6NeGPms2Y7np5Mr+hBUrGnNiPvuk85mYcpuIdZcyf ojxUqMiED0I5ELOsg+E0eZx0cK/6TkLHaneKHEAtv8DjjhBvi0IpcOcXVzEuo2BeZ0hg YRBRg5vmRtIfxCeE+pg3KKT7TqUFjO/pO+CsdsIRZjzwCM2Qnbp05hCZPQ5efNCdHq1v iGBNuzNxmebJvSAQDwqk7nwegnYo5Y5TqUmvNbw1Dn07NByOhFMaV6+0SuRsVEG1foyh 12qA== X-Gm-Message-State: AJIora/qBZ80L9En2PZI7D+q92nQI/SK5vCH4FkeUBA8sEv7UZwV1kwU UaKk2w7YO1sNKy06QGVO1tk= X-Google-Smtp-Source: AGRyM1s9pYxsIwPuQ+V9G/NdPA3CiUJ38zEJ2/XofucrwRTsF1z28UkKAx+NDrrZDAaVxaP8TDq8tg== X-Received: by 2002:ac8:5acf:0:b0:306:67ce:ac00 with SMTP id d15-20020ac85acf000000b0030667ceac00mr18844949qtd.267.1655726613995; Mon, 20 Jun 2022 05:03:33 -0700 (PDT) Received: from localhost ([66.150.196.58]) by smtp.gmail.com with ESMTPSA id j17-20020ac86651000000b0031169dc639csm391579qtp.86.2022.06.20.05.03.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jun 2022 05:03:33 -0700 (PDT) From: Ihor Radchenko To: David =?utf-8?Q?Luke=C5=A1?= Cc: Bruce D'Arcus , org-mode-email Subject: Re: oc-basic: CSL-JSON year as number vs. string (nativecomp?) In-Reply-To: References: <87h74h4ecd.fsf@localhost> Date: Mon, 20 Jun 2022 20:04:45 +0800 Message-ID: <875ykv4k2q.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::f2a; envelope-from=yantar92@gmail.com; helo=mail-qv1-xf2a.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1655726684; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=B7o71LLd1b5+n34tgcC2TjyHESQGQOUJOZKCNxvsFeg=; b=eFj+KRWNuBu2g6a9Okbnyi2yb5hQmuS9rRXLlwy6CRojPa3ZFrcmzrm8gPpbg7zY9iWQWs 3pCPDR2OIaA7nAEHpiD46JOd9PyZzhjpsVXBtvAyXXpf6qGM3Sff24a3f18cewMx74COl5 xPwgsaoDx4x1st2tdlbZ9cqxdFk4rEeBN7qFC/mzq0F5kQp8voty9aDXyEvuuhWxw/iDgb AeYAfYozzd8Cl/U3aD7ZPqzRzjgRtRqNScOLZzDuiUFGrRYIWsH1k3ZE0zvdAN/8On6scy XT7LXq0XabHU8f4efCz7GMeAF0F/OtEdvEZW0ZUlKBd8wh73bDbPxz6Rpn5ylg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1655726684; a=rsa-sha256; cv=none; b=JJqM8KD/Ed1wYiSxFXgAmHbKDncfGBubMZN10YkbONLguCe07E47KLz/tN0UwiJSE9VmNz 1q8SAQrLj4TnJ1a8GUe2DkOT5+NtPXAkocjSmc08SlU0u4gx0tzjEW9z+pOvAE0ODBB4Gf uWpanYAcQdCsZl+Vkb7pN8waSU0BUhAxPRR6XyR6w8OhUrj/5bad25uMUjN/SpoGglyoZ2 IuDmSU9YtFNMtbkEZ3xOH/0FE0taRWgGZiss5nmZ3BpeySIsypny9zlXd6UBZdfU75t0i3 oAt3aPVbaIis6Pp8uZaQ0907FgNOZclfZhWogQa84ZBO/T0mWmpNE398P0In/Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=BngrHgQC; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.97 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=BngrHgQC; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: D87A121A39 X-Spam-Score: -4.97 X-Migadu-Scanner: scn0.migadu.com X-TUID: ZCfXj6YJuvAw David Luke=C5=A1 writes: >> The JSON schema allows either: > > Ah, thanks for looking this up! So (format "%s" (caar date)) instead > of (number-to-string (caar date))? > > (That was actually my initial solution, purely out of being defensive > and trying to make sure it doesn't break in yet a different way should > other things than numbers turn up in date-parts, even nil or such. > Then I thought it was too hamfisted and didn't have the time to make a > case for being so defensive here. But since it's needed even just to > be *compliant*, the case seems quite clear now.) I'd prefer an explicit cond here. format "%s" may silently work on malformed json files and will mask issues with bibliography from the user. I personally hate when it happens and it is often easy to miss issues with downloaded bibliography entries. >> Can you provide an example json file demonstrating the problem? > > Sure, I'm attaching a short sample. Thanks! Would you mind creating a patch and possibly supplying a test that will make sure that the example file and similar are correctly parsed? Best, Ihor