[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.lisp

Regexes-two-problems, revisited.

Kaz Kylheku

4/22/2016 2:58:00 AM

Some people, fully aware that they will now have two problems if they
try to solve their original problem with regular expressions, think
about how to avoid this: "I know, I will instead just hand-code an
ad-hoc recognizer automaton!" Unfortunately, then they have at least
three problems.

--
Music DIY Mailing List: http://www.kylhe...
ADA MP-1 Mailing List: http://www.kylhe...
3 Answers

Madhu

4/27/2016 6:02:00 AM

0


* Kaz Kylheku <20160421195418.234@kylheku.com> :
Wrote on Fri, 22 Apr 2016 02:57:46 +0000 (UTC):

| Some people, fully aware that they will now have two problems if they
| try to solve their original problem with regular expressions, think
| about how to avoid this: "I know, I will instead just hand-code an
| ad-hoc recognizer automaton!" Unfortunately, then they have at least
| three problems.

This needs some explanation. Which is the third problem?

Barry Margolin

4/27/2016 2:25:00 PM

0

In article <m3potb7fos.fsf@leonis4.robolove.meer.net>,
Madhu <enometh@meer.net> wrote:

> * Kaz Kylheku <20160421195418.234@kylheku.com> :
> Wrote on Fri, 22 Apr 2016 02:57:46 +0000 (UTC):
>
> | Some people, fully aware that they will now have two problems if they
> | try to solve their original problem with regular expressions, think
> | about how to avoid this: "I know, I will instead just hand-code an
> | ad-hoc recognizer automaton!" Unfortunately, then they have at least
> | three problems.
>
> This needs some explanation. Which is the third problem?

It's derived from an older joke:

Some people, when confronted with a problem, think "I know, I'll use
regular expressions." Now they have two problems."

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***

Pascal J. Bourguignon

4/27/2016 5:58:00 PM

0

Madhu <enometh@meer.net> writes:

> * Kaz Kylheku <20160421195418.234@kylheku.com> :
> Wrote on Fri, 22 Apr 2016 02:57:46 +0000 (UTC):
>
> | Some people, fully aware that they will now have two problems if they
> | try to solve their original problem with regular expressions, think
> | about how to avoid this: "I know, I will instead just hand-code an
> | ad-hoc recognizer automaton!" Unfortunately, then they have at least
> | three problems.
>
> This needs some explanation. Which is the third problem?

One would be the maintainance problem, when the grammar changes, you
will have to maintain and debug again the recognizer automaton. And
possibly, the grammar could change of category, and you might not
realize it, trying to patch an automaton without changing its class!
(Notice he didn't say hand-code a recursive descent PARSER).

Another problem would be the ad-hoc part: it will work on the data at
hand, but it will break on any new data.


--
__Pascal Bourguignon__ http://www.informat...
â??The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.� -- Carl Bass CEO Autodesk