ket fn: extract-head


extract-head:
    description:
        extract-head ket
        categories are separated by ": "
        with the most general category on the left, and the most specific on the right
        for example |animal: mammal: dog>
        has the most general category "animal", then the category "mammal" and then finally the "value" dog
        This list of categories and the value can be considered a type of list
        extract-head returns the first element, or head, of this list

    examples:
        -- if there is no category, then return unchanged:
        extract-head |dog>
            |dog>

        extract-head |animal: mammal: dog>
            |animal>

        -- an abstract example:
        extract-head |a: b: c: d: e: f>
            |a>

    see also:
        extract-category, extract-value, extract-tail
Home