Re: An type for octets in the Binary Module

On 14 March 2013 14:21, Michael Kay wrote:

> For arguments, we generally avoid restricted types because it's
> such a pain to have to cast things to the relevant type.  So for
> octets-to-binary, the argument should be xs:integer*, allowing
> you to do octets-to-binary((0,0,255,255)).

  Yes, I know that rule and I think it makes perfect sense for
URIs to be xs:string instead of xs:anyURI.  But still I doubt it
would be useful to pass literal integer to bin:* functions.  I'd
write the above example bin:octets-to-binary(bin:hex('00FF')).

  For me that is a way to avoid worrying about implicit unboxing
and overflowing, and in contexts it has to happen then that's the
user's responsibility to do what he/she wants exactly to happen.

  Regards,

-- 
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/

Received on Thursday, 14 March 2013 14:59:36 UTC