[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [Patch] Table lookup functions: director's cut

From: Jarmo Hurri
Subject: [O] [Patch] Table lookup functions: director's cut
Date: Mon, 15 Oct 2012 10:25:59 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)


Here is the newest version of the patch implementing table lookup

First, to see what these little functions can do, take a look at


Please note that the patch is not in the official git repository yet, so
you can not replicate the examples in the tutorial. When and if I get
the word that the patch has been applied, I will add a link to the
tutorial in the main tutorial page on Worg.

A few notes on the patch:

1. There is now a third lookup function org-lookup-all, which I thought
   would be a very useful addition.

2. The three lookup functions are still defined by calls to a single
   macro. Heck, one of the advertised reasons for using Lisp are its
   macro capabilities, so I could not resist. The generated
   documentation strings now contain a reference to the macro, so users
   can locate the macro in org-table.el.

3. CL is no longer used in the implementation. I decided to implement
   the search using a while control structure. I wanted to do a tail
   recursive implementation, but then found out that Emacs Lisp does not
   do tail-call optimization. If you'd like me to use a different
   control structure (for some reason), I can change it.

4. Technically R-LIST is now an optional parameter in the lookup
   functions, because if it is nil, the matching value from S-LIST is
   returned directly. I decided not to define it to be an optional
   parameter, because that would simply look weird to a first-time user:
   the default use would then be to find a value and return the same
   value, which would not make much sense.

Have fun!


Attachment: 0001-Table-lookup-functions.patch
Description: table lookup functions

reply via email to

[Prev in Thread] Current Thread [Next in Thread]