EXPath binary module - suggestion - bin:insert-before()

Thinking about functions like bin:join() and (probably to be renamed) 
bin:subsequence(), it occurred to me that an equivalent of 
fn:insert-before() might be i) useful, ii) fast by comparison with 
break-and-join and iii) trivial to implement given the other implemented 
functions.

    bin:insert-before($in as xs:base64Binary, $offset as xs:integer,
    $new as xs;base64Binary) as xs:base64Binary

which inserts $new into the octet sequence at the $offset octet, 
shifting the remainder backwards. Whilst there isn't a string equivalent 
function, inserting into item()* sequences was considered important 
enough to warrant a specific function.

A minor point perhaps, but very easy to put in at this stage. Thoughts?
-- 
*John Lumley* MA PhD CEng FIEE
john@saxonica.com <mailto:john@saxonica.com>
on behalf of Saxonica Ltd

Received on Monday, 5 August 2013 13:00:59 UTC