ecl-logo Documentation

LookupPath

LookupPath[data,path]value

given a nested data structure that can have Lookup or Part called on it, traverse a path through it and return the value at the path.

Details

    Input
    Output
    Messages
  • InnerPathDataErrorEncountered 'non-lookable' data typed element `1` along path at key `2`

Examples

Basic Examples  (5)

Simple nested path:

Simple nested path with index:

Works with lists of Rules and Associations:

When a component of the path references something not in the data, Missing is returned:

When a indexing into a List that is out of bounds, return Missing[IndexOutOfBounds]:

Additional Examples  (2)

When path references something that cannot be looked up into, then $Failed is returned and a Message is displayed:

Empty paths are always Missing:

Messages  (1)

InnerPathDataError  (1)

A failure is returned is any non-Lookup-compatible data along the requested lookup path is encountered: