def switch(*args):
    """:yaql:switch

    Returns the value of the first argument for which the key evaluates to
    true, null if there is no such arg.

    :signature: switch([args])
    :arg [args]: mappings with keys to check for true and appropriate values
    :argType [args]: chain of mapping
    :returnType: any (types of values of args)

    .. code::

        yaql> switch("ab" > "abc" => 1, "ab" >= "abc" => 2, "ab" < "abc" => 3)
        3
    """
    for mapping in args:
        if mapping.source():
            return mapping.destination()