Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Oberon > Re: Of constant...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 9 of 28 Topic 442 of 502
Post > Topic >>

Re: Of constants and variables

by "Chris Burrows" <cfbsoftware@[EMAIL PROTECTED] > Oct 22, 2007 at 10:26 PM

"Xcriber51 >" <Ken <ken-tusc@[EMAIL PROTECTED]
> wrote in message 
news:5d7be11b299d14924c81dcc3ae4b0378@[EMAIL PROTECTED]
> OK, thanks everyone for dropping an explanation. Can't say I have fully
> appreciated the technical reasons, but I think I now know the human
> reasons involved.
>
> In summary, We have 3 solutions here:
>

I propose a fourth solution that might go something like:

PROCEDURE SoundexMap(ch: CHAR): INTEGER;
BEGIN
   CASE CAP(ch) OF
      "A", "E", "I", "O", "U":
         RETURN 0 |
      "B", "F", "P", "V":
         RETURN 1 |
      "C", "G", "J", "K", "Q", "S", "X", "Z":
         RETURN 2 |
      "D", "T":
         RETURN 3 |
      "H", "L":
        RETURN 4 |
      "M", "N":
        RETURN 5 |
      "R":
        RETURN 6 |
      "W", "Y":
        RETURN 7
    END
END SoundexMap;

It should be as efficient but much less obscure than the other three 
solutions. Readers / maintainers of the code then have a better chance of 
verifying that this algorithm is doing what it is intended to do.  e.g. it

might lead to the question: Shouldn't "W", "Y" and "H" return 0 instead of

7, 7 and 4?

--
Chris Burrows
CFB Software
http://www.cfbsoftware.com/gpcp
 




 28 Posts in Topic:
Of constants and variables
"Xcriber51" <  2007-10-18 07:05:37 
Re: Of constants and variables
Stefano Ferrari <ferra  2007-10-18 07:36:44 
Re: Of constants and variables
"Xcriber51" <  2007-10-18 11:02:56 
Re: Of constants and variables
pjb@[EMAIL PROTECTED] (P  2008-06-13 20:55:42 
Re: Of constants and variables
Stefano Ferrari <ferra  2007-10-19 01:22:44 
Re: Of constants and variables
Stefano Ferrari <ferra  2007-10-19 01:34:25 
Re: Of constants and variables
"Xcriber51" <  2007-10-19 07:28:00 
Re: Of constants and variables
"Xcriber51" <  2007-10-22 05:41:51 
Re: Of constants and variables
"Chris Burrows"  2007-10-22 22:26:19 
Re: Of constants and variables
"Xcriber51" <  2007-10-22 12:20:08 
Re: Of constants and variables
"Chris Burrows"  2007-10-23 08:58:31 
Re: Of constants and variables
Stefano Ferrari <ferra  2007-10-19 06:09:17 
Re: Of constants and variables
"Chris Burrows"  2007-10-19 23:16:52 
Re: Of constants and variables
=?ISO-8859-1?Q?Christian_  2007-10-19 18:43:54 
Re: Of constants and variables
fmw@[EMAIL PROTECTED] (F  2007-10-19 16:06:35 
Re: Of constants and variables
=?ISO-8859-1?Q?Christian_  2007-10-19 18:33:11 
Re: Of constants and variables
August Karlstrom <fusi  2007-10-21 11:47:08 
Re: Of constants and variables
Ulrich <keine@[EMAIL P  2007-12-02 19:15:58 
Re: Of constants and variables
Ulrich <keine@[EMAIL P  2007-12-02 19:13:44 
Re: Of constants and variables
comp.lang.oberon@[EMAIL P  2007-12-02 23:01:11 
Re: Of constants and variables
Ulrich <keine@[EMAIL P  2007-12-07 00:23:22 
Re: Of constants and variables
comp.lang.oberon@[EMAIL P  2007-12-07 09:47:11 
Re: Of constants and variables
August Karlstrom <fusi  2007-10-21 11:58:00 
Re: Of constants and variables
Ulrich <keine@[EMAIL P  2007-12-02 19:29:01 
Re: Of constants and variables
Stefano Ferrari <ferra  2007-10-21 14:52:20 
Re: Of constants and variables
August Karlstrom <fusi  2007-10-22 17:57:46 
Re: Of constants and variables
Ulrich <keine@[EMAIL P  2007-12-02 19:23:15 
Re: Of constants and variables
fmw@[EMAIL PROTECTED] (F  2007-10-22 10:20:49 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 1:49:15 CST 2008.