Some all but random responses.

First,

<begin extract>
That's all well and good for two character values but obviously
doesn't scale beyond a half-word.
</end extract>

The problem I was addressing was a two-character/halfword one, and I
raised it originally to illustrate one egregious way in which the IBM
Enterprise COBOL compilers were deficient in their handling of
language constructs, specifically EVALUATE for one- and two-character
arguments.  I chose this example because there are canonical, well
understood, and not at all controversial branch-table based schemes
available for implementing C switch statements and PL/I select(<single
character>) groups.

I was not proposing a panacea, about any and all of which I am
generically suspicious.

Next,

<begin extract>
I'm glad I said "median", rather than "mode".  For the latter
frequency statistics would be required.
</end extract>

Frequency statistics are required for the former too.  To say
otherwise is to confound frequency class-interval definitions with
their associated counts.

The 'exponential' vs 'logarithmic' issue is more complicated, but here
I do concede that these two algorithms are better contrasted using
'polynomial time' and 'logarithmic time'.

I come now to

<begin extract>
If all the keys are already known then a perfect hash optimized switch
statement is one of the most efficient methods I've seen.  Especially
popular with compiler writers for the symbol table.
</end extract>

It seems to me to mix two topics.   The reserved or key words of a
statement-level language are "already known".  The identifiers used in
a source program written in such a language are not.  (One could of
course conjecture that 'I' or 'i' will be used as the identifier of an
indexing subscript in many, even most FORTRAN programs; but I am not
sure that this sort of thing would be very helpful.)

The C language switch statement is defined very specifically and
carefully as an SBCS single-character facility.  Not at all
incidentally, this definition ensures that branch tables can always be
used to implement a C switch statement.

I do agree, if that be the right word, that hashing schemes have
historically been much used for symbol-table management by the writers
of compilers and assemblers.  (If challenged before the fact,  I
should also be quite willing to 'agree' that the earth is an oblate
spheroid.)

John Gilmore, Ashland, MA 01721 - USA

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to