ecl-logo Documentation

FieldReferenceP

FieldReferenceP[]pattern

returns a pattern which matches any field reference.

FieldReferenceP[type]pattern

returns a pattern which matches any field reference of the given type.

FieldReferenceP[type,field]pattern

returns a pattern which matches any field reference of the given type and field.

FieldReferenceP[type,field,index]pattern

returns a pattern which matches any field reference of the given type and index of the given field.

Details

  • A 'field reference' is a reference to a specific field in a given object.
  • Downloading a 'field reference' will fetch the value of the field from the given object.
  • Input
    Output

Examples

Basic Examples  (3)

Match a field reference:

Does not match a field reference of the wrong type:

Does not match a field reference with the wrong field:

Additional Examples  (3)

Matches a field reference if it is one of a list of types:

Matches a field reference if it is one of a list of types and fields:

Does not match a field reference if the index of the field does not match: