Re: Decision Tables



"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.
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.
Decision table solution

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.

In this case you've under-engineered the solution. (For a thread on
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.
.



Relevant Pages

  • Re: Decision Tables
    ... 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. ...
    (comp.programming)
  • Re: Peter Watts
    ... Canada for lunch while visiting my girlfriend in Detroit: ... We paid our toll and rolled up to the border guard, ... cheques into the country, and making us mighty grateful we'd gotten the ... Canadian citizenships for being so brave and honest to the border guard, ...
    (rec.music.filk)
  • Re: Another Sterling Massachusetts Alum
    ... but I would suspect that Canada got more ... Here are a few facts for you to chew on regarding your own country. ... took action to hide and help Jewish refugees escape with their ... up to dictators and terrorists since at least Hitlers days, ...
    (alt.sports.baseball.ny-yankees)
  • Re: Its open season on crooks down here in Texas
    ... >>> Crime is much lower in socialist countries like Canada, Australia ... >> Burglaries by country: ...
    (alt.politics)
  • Re: OT RE:Re: Letterman is a joke
    ... Canada always has and always will takes its own directions. ... You're country is very mercenary in who it supports. ... We earned the right to swagger. ... >>>But I'll concede we do have a power grab problem. ...
    (alt.guitar.amps)