Re: Decision Tables
- From: Ben Bacarisse <ben.usenet@xxxxxxxxx>
- Date: Mon, 28 Jan 2008 16:50:10 +0000
"Malcolm McLean" <regniztar@xxxxxxxxxxxxxx> writes:
"Leslie Sanford" <jabberdabber@xxxxxxxxxxxxxxxxx> wrote in message
The thing is is that we may only be interested in matching certain fields.Decision table solution
For example, I may only be interested in filtering messages where the
LastName is Jones and the Country is Canada. So I'd like my match
function to compare the received message to my comparison
message. If the LastName is Jones and the Country is Canada, I'd
like it to return true.
In this case you've under-engineered the solution. (For a thread on
I'm also wondering if I've over-engineered a solution. That's one of my
faults when approaching a problem. So I'd appreciate any thoughts or
insights.
under and over-engineering, see the malloc() and xmalloc() threads on
comp.lang.c).
You need either a regualr expression parser, or a wildcard
matcher.
I don't see why this is the way to go. The OP seems to want to
restrict the matching to certain sets of fields in a structure. I
can't see how regular expressions help with that part at all. Useful
as a extension, though, within a field.
The latter is much easier to write and use. An example was
posted here by Spinoza1111, and there's also one on my website.
To the OP: the posted code had bugs. The original upon which the
buggy code was based is from "The Practice of Programming"
by Brian W. Kernighan and Rob Pike[1].
[1] http://cm.bell-labs.com/cm/cs/tpop/code.html (the grep program
from chapter 9).
--
Ben.
.
- References:
- Decision Tables
- From: Leslie Sanford
- Re: Decision Tables
- From: Malcolm McLean
- Decision Tables
- Prev by Date: Re: Where do two linked lists merge?
- Next by Date: Re: Decision Tables
- Previous by thread: Re: Decision Tables
- Next by thread: Re: Decision Tables
- Index(es):
Relevant Pages
|