Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

GAWK API Question #2

35 views
Skip to first unread message

Kenny McCormack

unread,
Jan 15, 2015, 11:55:08 AM1/15/15
to
In working my way through the sample code in the GAWK distribution
while developing my latest extension library, it occurred to me that there
probably exists actual documentation for the API - and that for some
reason, I have not found it. Is there some place else I should look?

I say this because I've found that the only way to figure this stuff out
(and which, don't get me wrong, has worked out well for me) is a
combination of the following two sources:

1) Reading the existing, minimal, documentation in chapter 16 of the fine
GAWK Users Manual (found at this URL:)

http://www.gnu.org/software/gawk/manual/gawk.html

and:

2) Reading through the example code supplied in the distribution.

My personal view is that in a perfect world, the later should not be necessary.
I.e., I think we all feel, deep in our tummies, that if you have to resort
to reverse engineering to figure out how something works, then that
something is not as well documented as it should be. It is pretty clear to
me that no one could figure it out without the supplied sample source code.

Therefore, I suspect that there is some document somewhere, if only in the
hands of the "official" GAWK developers, that documents this more fully.
Is there any chance that this could be uploaded at some point and the URL
for it made public?

Thanks in advance.

--

There are many self-professed Christians who seem to think that because
they believe in Jesus' sacrifice they can reject Jesus' teachings about
how we should treat others. In this country, they show that they reject
Jesus' teachings by voting for Republicans.

Andrew Schorr

unread,
Jan 15, 2015, 7:59:03 PM1/15/15
to
Hi Kenny,

On Thursday, January 15, 2015 at 11:55:08 AM UTC-5, Kenny McCormack wrote:
> Therefore, I suspect that there is some document somewhere, if only in the
> hands of the "official" GAWK developers, that documents this more fully.
> Is there any chance that this could be uploaded at some point and the URL
> for it made public?

I'm not aware of any hidden documentation. I think Arnold spent a lot of time developing the texinfo documentation that you see in the manual. What is missing there?

Personally, I use the gawkapi.h header file in conjunction with previously written extensions to figure out what to do. The gawkextlib library also has a few helper functions to make it easier to create arrays and variables, should that be relevant.

Are there any specific aspects of the API that you feel are not adequately documented?

Regards,
Andy

Kenny McCormack

unread,
Jan 16, 2015, 6:23:47 AM1/16/15
to
In article <a048211e-d63d-4b32...@googlegroups.com>,
Andrew Schorr <asc...@telemetry-investments.com> wrote:
>Hi Kenny,
>
>On Thursday, January 15, 2015 at 11:55:08 AM UTC-5, Kenny McCormack wrote:
>> Therefore, I suspect that there is some document somewhere, if only in
>> the hands of the "official" GAWK developers, that documents this more
>> fully. Is there any chance that this could be uploaded at some point
>> and the URL for it made public?
>
>I'm not aware of any hidden documentation.

I'm actually surprised by that. Quite seriously, as I was sitting there
writing my code, I was saying to myself "This can't be all there is." and
"There must be some other document out there - that the official developers
use."

>I think Arnold spent a lot of time developing the texinfo documentation
>that you see in the manual. What is missing there?

It's the usual "Unix thing". It's all there, but a person couldn't figure
it out strictly from that. As is often said about Unix man pages, it only
makes sense if you already know it.

>Personally, I use the gawkapi.h header file in conjunction with previously
>written extensions to figure out what to do. The gawkextlib library also
>has a few helper functions to make it easier to create arrays and
>variables, should that be relevant.

Exactly. As have I. And, as I've noted, it works. It works for you and
it works for me. But I think we can all agree that, in a perfect world,
understanding something shouldn't require reverse engineering. As I said,
if you have to reverse engineer it, then the documention is lacking.

>Are there any specific aspects of the API that you feel are not adequately
>documented?

Not really. (somewhat facetiously) Just all of it.

But this did arise specifically in the context of traversing arrays. I got
it working, of course, but as said, only by reverse engineering the sample
code.

--
"They shall be attended by boys graced with eternal youth, who to the
beholder?s eyes will seem like sprinkled pearls. When you gaze upon that
scene, you will behold a kingdom blissful and glorious."

--- Qur'an 76:19 ---

Andrew Schorr

unread,
Jan 20, 2015, 9:20:31 AM1/20/15
to
On Friday, January 16, 2015 at 6:23:47 AM UTC-5, Kenny McCormack wrote:
> But this did arise specifically in the context of traversing arrays. I got
> it working, of course, but as said, only by reverse engineering the sample
> code.

Did you look at section 16.4.11 "Array Manipulation" and, in particular, section 16.4.11.3 "Flattening Arrays", also titled "Working With All The Elements of an Array"? That section appears to be fairly detailed. Which information is it missing?

Regards,
Andy

Kenny McCormack

unread,
Jan 20, 2015, 10:19:41 AM1/20/15
to
In article <943d88e2-9bdb-4fa4...@googlegroups.com>,
I appreciate your comments. It is good that you are responding to my posts.

But at some point, this becomes semantics. I never really claimed that
anything was "missing" - just that no one (for suitable values of "no one")
would be able to figure it out based solely on the "GAWK manual". As in
many/all such situations, I apply what has been called "The Kenny Gold
Standard" - which is, if I find something difficult, most people will find
it impossible.

To put this another way, consider the analogy fo Unix man pages again.
Everybody understands that nothing is "missing" from a typical Unix man
page, but no one claims you can learn how to use something from the man
page alone (yes, there are exceptions). That's why there is a healthy
market in 3rd party books on just about every computer subject imaginable.

I just assume that there is or should be a similar document/3rd party book
for the GAWK API.

--
"Although written many years ago, Lady Chatterley's Lover has just
been reissued by the Grove Press, and this fictional account of the
day-to-day life of an English gamekeeper is still of considerable
interest to outdoor minded readers, as it contains many passages on
pheasant raising, the apprehending of poachers, ways to control vermin,
and other chores and duties of the professional gamekeeper.

"Unfortunately, one is obliged to wade through many pages of extraneous
material in order to discover and savor these sidelights on the
management of a Midlands shooting estate, and in this reviewer's opinion
this book cannot take the place of J.R. Miller's Practical Gamekeeping"
(Ed Zern, Field and Stream, November 1959, p. 142).
0 new messages