bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] Adding an API hook to enable a select extension


From: Eli Zaretskii
Subject: Re: [bug-gawk] Adding an API hook to enable a select extension
Date: Fri, 31 May 2013 09:00:35 +0300

> Date: Thu, 30 May 2013 21:12:14 -0400
> From: "Andrew J. Schorr" <address@hidden>
> 
> At the risk of making Brian Kernighan throw up, since he believes no awk
> program should be longer than 2 lines, I propose the attached patch to the 
> API.
> I could be mistaken, but I think this should be enough to implement a select
> extension.  If the name argument is NULL, it would return &curfile.public.
> Otherwise, it would return &getredirect(name, strlen(name))->iop->public.  We
> might want to replace the red_head array with a hash table to optimize the
> performance of getredirect.
> 
> User code might look something like this:

Is it really a good idea to leak such low-level details to Gawk
program level?  Can't we come up with some higher-level abstraction
for this, like conceal the entire while(1) loop in Gawk internals, and
present just some operator or function(s) on the Gawk script level?



reply via email to

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