Colleen Whitney wrote: Colleen,
> Function mapping isn't forcing a function that accepts a singleton > to accept a sequence. It just allows you to process a sequence > using a function that takes a singleton (by repeatedly calling that > function under-the-covers). So type checking isn't broken with > function mapping, although when you first bump into it it can feel > that way. Thank you for your response. Actually, I think type checking IS broken. When I write that a function argument must be a singleton, I want my expression to fail if it is not the case. I think there are two cases where cardinality checking is useful: to ensure that a sequence has at least one item (singleton and +) and to ensure that a sequence has no more than one item (? and singleton). And function mapping breaks the second one (oh, and actually the first one too, because even when you provide an empty sequence, the evaluation doesn't fail, the function is just not called.) Without any extension at compile time, nor the use of an extension function, the behaviour of a function call is changed. I my humble opinion, I don't think saving a few characters is worth that change. PS: I do love MarkLogic, and I do love experimenting with extensions and new features. But I think this one is such a huge and hidden change in behaviour to be made the default, even in 1.0-ml. Regards, -- Florent Georges http://www.fgeorges.org/ _______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general
