From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Ecay Subject: Re: problems with export and :cache Date: Thu, 29 Oct 2015 17:05:05 +0000 Message-ID: <87d1vxy5a6.fsf@gmail.com> References: <87vb9pyf0l.fsf@gmail.com> <871tcdpxeq.fsf@nicolasgoaziou.fr> <87io5pyaeo.fsf@gmail.com> <87wpu5occ0.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42843) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrqdV-0001Ow-Cc for emacs-orgmode@gnu.org; Thu, 29 Oct 2015 13:05:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZrqdQ-0001nQ-Cx for emacs-orgmode@gnu.org; Thu, 29 Oct 2015 13:05:13 -0400 Received: from mail-wi0-x229.google.com ([2a00:1450:400c:c05::229]:33361) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrqdQ-0001nF-6q for emacs-orgmode@gnu.org; Thu, 29 Oct 2015 13:05:08 -0400 Received: by wijp11 with SMTP id p11so293409862wij.0 for ; Thu, 29 Oct 2015 10:05:07 -0700 (PDT) In-Reply-To: <87wpu5occ0.fsf@nicolasgoaziou.fr> 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nicolas Goaziou , Andreas Leha Cc: emacs-orgmode@gnu.org Hi Nicolas, 2015ko urriak 29an, Nicolas Goaziou-ek idatzi zuen: > Could these 2 use cases be refactored? >=20 > (mapcar #'cdr (org-babel-get-header params :var)) >=20 > is not very far (but stlightly different) from >=20 > (cadr (org-babel-get-header params :colname-names)) >=20 > when there is a single association in PARAMS. Otherwise, it is up to the > user to know that there can be multiple :var keys but only > one :column-names. But users know that anyway, since it=E2=80=99s implied by the semantics of :colname-names. Actually the most typical way of accessing the value of :colname-names in the code is (cdr (assoc :colname-names params)) (~20 uses, which ought to use assq instead); using o-b-get-header for :colname-names is an exception. The issue is that o-b-g-h gives an API for accessing key-values in a 1:many mapping. But :var is the only key that can actually be 1:many. All other keys are singletons, and can be handled through the usual emacs API for 1:1 mappings (assq and friends) =E2=80=93 and in the existing codebase they often are. If we provide an API within babel, we should make it as specific as possible. (OTOH if we provide 1:many mapping access, we should name it org-assq-multiple or something like that. But it=E2=80=99s unnecessary in = this case.) --=20 Aaron Ecay