[Cook] table lookup

Jerry Pendergraft jerry at endocardial.com
Fri Jun 6 05:45:07 EST 2003


something like:

table = 
C                       .c
C++                     .cpp
Java                    .j
Yacc                    .y
    ;

all :
{
    local type = Java;

    local ext = [word [expr 1 "+" [in [type] [table]]] [table]];

    function print [type] "->" [ext];
}

Course some might say that an expression like:
  [word [expr 1 "+" [in [type] [table]]] [table]];
is tantamount to a function ;^)

-- 
Jerry Pendergraft                        jerry.pendergraft at endocardial.com
Endocardial Solutions                    voice: 651-523-6935
1350 Energy Lane, Suite 110                fax: 651-644-7897
St Paul, MN 55108-5254                  mobile: 651-491-0163

On Thu, 5 Jun 2003, Aryeh M. Friedman wrote:

> 
> If I have a table that is something like this:
> 
> Col 1			Col 2
> -----------------------------
> C			.c
> C++			.cpp
> Java			.j
> Yacc			.y
> etc.
> 
> 	Can I do a direct lookup up without writing a function to do it?
> 
> 	--Aryeh
> _______________________________________________
> Cook-users mailing list
> Cook-users at auug.org.au
> http://www.auug.org.au/mailman/listinfo/cook-users
> 




More information about the Cook-users mailing list