ecl-logo Documentation

UnitCoordinatesP

UnitCoordinatesP[]patt

returns a pattern that matches if 'val' is a set of coordinate pairs, either as a list of numbers, list of quanitties, or quantity array.

UnitCoordinatesP[unitSpec]patt

also tests that the values in 'val' match the units or constraints in unitSpec.

Details

    Input
    Output
    Attributes
  • HoldFirst

Examples

Basic Examples  (4)

Match a list of numeric coordinates:

Match a list of quantity coordinates:

Match a quantity array of coordinates:

Match a list of quantity coordinates where each coordinates is {time,distance}:

Additional Examples  (6)

Match a list of quantity coordinates along with constraints on the coordinate values:

Does not match if unit dimensions incompatible:

Does not match if magnitude comparisons fail:

Mixed list of constraints:

List of date coordinates in a list:

List of date coordinates in a QA:

Attributes  (1)

HoldFirst  (1)

The pattern function's argument is held: