GNU bug report logs - #16581
suggested code simplification in dfa.c

Previous Next

Package: grep;

Reported by: Aharon Robbins <arnold <at> skeeve.com>

Date: Tue, 28 Jan 2014 20:12:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 16581 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Aharon Robbins <arnold <at> skeeve.com>, 16581 <at> debbugs.gnu.org
Subject: Re: bug#16581: suggested code simplification in dfa.c
Date: Tue, 28 Jan 2014 22:48:16 -0800
[Message part 1 (text/plain, inline)]
Aharon Robbins wrote:
> that exclusive-ORing looks a little scary to me.

It is derived from a coding hack that I picked up from Dijkstra back in 
the 1970s.  He gave the most boring computer-science lecture I have ever 
attended -- so boring that Kit Fine walked out a few minutes into it -- 
but I stubbornly stayed through to the end and I've never forgotten the 
hack.

The hack works everywhere, including platforms that use EBCDIC, 
shift-JIS, DBCS, etc., because it doesn't rely on the encoding scheme at 
all.  Attached is a revised patch that adds some commentary and breaks 
the hack into some functions that I hope help explain things.  Sorry, I 
don't know how to break this into smaller patches that would be easier 
to understand.
[0001-Simplify-handling-of-letter-case.patch (text/x-patch, attachment)]

This bug report was last modified 11 years and 79 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.