Here's a wishlist idea that somehow never quite crystallized in my mind
until just now.

The same way stages like CHANGE and XLATE can operate on a list of input
ranges, it would be a huge convenience if LOOKUP could take lists of
input ranges for its key fields.  Instead of having to maintain a pile of
SPECS stages to add and remove extra copies of the key fields:

  (end /)          ... | specs w1 1 w3 n  1-* n 
  | a: lookup w1.2 1-7 | specs w2-* 1 write read 8-* 1 | ...
  /                ... | specs 6.6 1 22 n 1-* n 
  | a:                 | specs w2-* 1 | ...
  / a:                 | specs 8-* 1  | ...

we could just specify the lists of ranges on LOOKUP:

  ... | a: lookup (w1 w3) (6.6 22) | ...

One obvious flaw you can see in this example is that it doesn't provide
for lists of words or ranges to be separated in any way, so it wouldn't
distinguish between, say, these two records on the primary:

  The very nice boy shot his new Red Rider BB gun at the target.
  Then some ice fell off the roof and hit his glasses, he said.

I can see some cases where that behavior is desirable, and others where
it's not, actually.  My thought is that it could additionally take
WordBoundary and FieldBoundary keywords, considered to match either
another WB/FB spec or the WS/FS character.  For instance:

  lookup (w1 w2.2) (w3 wb w2 w1)

would match "her self hatred" with "red hat herself".  I have a vague
feeling there might be a reason to give special treatment to boundaries
before and after a missing input range, but I'm not sure exactly what
that would be.  Would it be useful for this:

  lookup (w1 wb w2) (w2 wb w1)

to match a one-word record with itself?  I'm not sure.

¬R

Reply via email to