[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] problems with export and :cache
From: |
Aaron Ecay |
Subject: |
Re: [O] problems with export and :cache |
Date: |
Thu, 29 Oct 2015 17:05:05 +0000 |
User-agent: |
Notmuch/0.20.2+65~gbd5504e (http://notmuchmail.org) Emacs/25.0.50.2 (x86_64-unknown-linux-gnu) |
Hi Nicolas,
2015ko urriak 29an, Nicolas Goaziou-ek idatzi zuen:
> Could these 2 use cases be refactored?
>
> (mapcar #'cdr (org-babel-get-header params :var))
>
> is not very far (but stlightly different) from
>
> (cadr (org-babel-get-header params :colname-names))
>
> 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’s 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) – 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’s unnecessary in this
case.)
--
Aaron Ecay
- [O] problems with export and :cache, Andreas Leha, 2015/10/28
- Re: [O] problems with export and :cache, Andreas Leha, 2015/10/29
- Re: [O] problems with export and :cache, Aaron Ecay, 2015/10/29
- Re: [O] problems with export and :cache, Nicolas Goaziou, 2015/10/29
- Re: [O] problems with export and :cache, Aaron Ecay, 2015/10/29
- Re: [O] problems with export and :cache, Thomas S . Dye, 2015/10/29
- Re: [O] problems with export and :cache, Andreas Leha, 2015/10/29