context function 2: apply


apply:
    description:
        apply(seq, seq)
        wrapper around apply op

    examples:
        -- learn some knowledge
        age |Fred> => |35>
        nick-name |Fred> => |Freddie>
        mother |Fred> => |Jude>
        father |Fred> => |Tom>
        age |Jude> => |61>

        -- implements: age |Fred>
        apply(|op: age>, |Fred>)
            |35>

        -- implements: age |Fred> + mother |Fred> + father |Fred>
        apply(|op: age> + |op: mother> + |op: father>, |Fred>)
            |35> + |Jude> + |Tom>

        -- implements: age |Fred> . mother |Fred> . father |Fred>
        apply(|op: age> . |op: mother> . |op: father>, |Fred>)
            |35> . |Jude> . |Tom>

        -- the star operator, which adds all the right hand rules together:
        star |*> #=> apply(supported-ops|_self>, |_self>) |>

        -- Eg, applied to Fred:
        star |Fred>
            |35> + |Freddie> + |Jude> + |Tom>

        -- using an operator sequence instead:
        -- implements: age mother |Fred>
        apply(|ops: age mother>, |Fred>)
            |61>

    see also:
        learn, add-learn, seq-learn
Home