MorePfsEnumeration.mesa
Copyright Ó 1990 by Xerox Corporation. All rights reserved.
Last tweaked by Mike Spreitzer on March 30, 1992 2:56 pm PST
= {
OPEN
PFS;
EnumerateForNames: Enumerator;
EnumerateForInfo: PROC [pattern: PATH, proc: InfoProc, lbound: PATH ← NIL, hbound: PATH ← NIL ];
Enumerator: TYPE ~ PROC [pattern: PATH, proc: NameProc, lbound: PATH ← NIL, hbound: PATH ← NIL];
Caser: TYPE ~ PROC [PATH] RETURNS [sensitive: BOOL];
ETester: TYPE ~ PROC [PATH] RETURNS [BOOL];
TransformEnumerator:
PROC [base: Enumerator, caser: Caser, exists: ETester, pattern:
PATH, proc: NameProc, lbound:
PATH ←
NIL, hbound:
PATH ←
NIL ];
Implements our kind of enumeration(for names) in terms of an old, stupid one (which cannot handle double-star, and can handle star only in the last component), passed in base. The caser reveals which names are case-sensitive. The ETester is a special case of the base enumerator that just tests whether one literal name would be enumerated.
PfsCaser: Caser;
PfsETester: ETester;
}.