ecl-logo Documentation

ListableP

ListableP[pattern]outputPattern

generates an outputPattern which matches pattern or a list of pattern.

ListableP[pattern,maxLevel]outputPattern

generates an outputPattern which matches pattern, or a nested list of pattern up to maxLevel.

ListableP[pattern,{maxLevel}]outputPattern

generates an outputPattern which matches a nested list of pattern only at the given maxLevel.

ListableP[pattern,{minLevel,maxLevel}]outputPattern

generates an outputPattern which matches a nested list of pattern between minLevel and maxLevel.

Details

  • ListableP does not generate a pattern which will match an empty list at any level.
  • Input
    Output

Examples

Basic Examples  (4)

If given no level-spec generates a pattern of single element or list of elements:

If given single level spec integer, generates pattern from level 0 to integer:

If single element in list as level spec, generates listed pattern at only that level:

If given span as level spec, generates pattern between given levels:

Additional Examples  (2)

Does not evaluate if level-spec is negative:

Does not evaluate if minLevel > maxLevel: