From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH 1/3] ob-table: Fix org-sbe's handling of quotes in arguments Date: Sun, 18 Mar 2018 23:24:31 +0100 Message-ID: <87a7v5c99c.fsf@nicolasgoaziou.fr> References: <20180307225847.24068-1-git@thecybershadow.net> <20180307225847.24068-2-git@thecybershadow.net> <87muzcans9.fsf@nicolasgoaziou.fr> <9107300b-c95d-ad16-ca03-088d173c90d9@gmail.com> <87605yn4x3.fsf@nicolasgoaziou.fr> <8258182a-5d7e-d8c9-96c2-1a76dd9e143c@gmail.com> <87fu52ln2g.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36615) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1exgjH-00017D-0o for emacs-orgmode@gnu.org; Sun, 18 Mar 2018 18:24:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1exgjD-00033q-Nf for emacs-orgmode@gnu.org; Sun, 18 Mar 2018 18:24:39 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:58305) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1exgjD-00032U-I3 for emacs-orgmode@gnu.org; Sun, 18 Mar 2018 18:24:35 -0400 In-Reply-To: (Vladimir Panteleev's message of "Wed, 14 Mar 2018 16:23:58 +0000") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Vladimir Panteleev Cc: emacs-orgmode@gnu.org, Vladimir Panteleev Hello, Vladimir Panteleev writes: > On 2018-03-14 15:00, Nicolas Goaziou wrote: >> I disagree. You are testing an implementation detail here: the fact that >> "$" is not necessarily a prefix. According to the docstring, it should >> be, so the test should use that, too. What if we rewrite `org-sbe' at >> some point? > > I'm sorry if I didn't explain it properly in my previous messages. > I'll try again. > > The fact that $"foo" and $ "foo" mean the same thing is not an > implementation detail of org-sbe. It is a consequence of Emacs Lisp > grammar. [...] > So, whether the test case has a space between $ and "a\"b\"c" is as > relevant as whether it has comments, or uses tabs instead of spaces > for indentation. > > I hope this explanation can put this issue to rest. We're clearly mis-communicating. I know the difference between a symbol and a string, and how `read' operates. I think what puzzles me is some design choices made in `org-sbe', and the fact that the second note of its docstring is clear as mud. > org-sbe's docstring is misleading: I agree. > $ is not a way to quote just table references, but any string literals > in general. Had it been otherwise (i.e. $-prefixing being part of the > table reference syntax), there would be no way to pass a string > literal (which isn't an interpolated table cell value) to the > indicated function. The doc string should probably be improved in this > regard. I consider it to be a bug if you need to write $"string" instead of "string" in any `org-sbe' call. We should not test such a mis-feature, which should be removed. > Adding a test which uses a table reference instead of a string literal > won't hurt, but it would be testing several layers at once, and, > assuming cell value interpolation into emacs lisp table formulas is > already tested somewhere else, superfluous. Let me insist on this. $"string" (or $ "string") is very wrong. Please do not write your tests on top of this. IIUC, `org-sbe' is about passing table fields into source blocks. Let's test that instead, with a table, and a source block. I don't mind superfluous coverage. It is just a matter of tests. Your changes sound good. So, would you mind adjusting your tests so we can move forward? Regards, -- Nicolas Goaziou