On PROPOSAL Narrow Hexadecimal and Binary Integer Literals

Joseph D. Darcy Joe.Darcy at Sun.COM
Wed May 6 22:14:58 PDT 2009


Weijun Wang wrote:
> Hi All
>
> I'm reading this proposal, which recommends:
>
>    byte[] stuff = { 0x00, 0x7F, (byte)0x80,  (byte)0xFF};
>
> can be recoded as
>
>    byte[] ufum7 = { 0h00, 0h7F, 0h80, 0hFF};
>
> How about using the C style?
>
>    byte[] bs = '\x00\x7f\x80\xff';
>
> This should work since multiple bytes in '' is illegal now. When you
>   

I think this style of syntax is too far of a departure from current 
practice.

> want to create a byte[] with only one element, you still have to write
>
>    byte[] bs = { 0x00 };
>
> BTW, if the VM can be enhanced to support byte[] in constant pool, that
> will be even better. Of course, if the VM is already able to view
> bytecodes from the statement above as a single byte block reference,
> that's enough.
>
> Thanks
> Max
>
>   

Better VM support for constant data of various kinds would be handy, but 
outside the scope of Coin.

-Joe



More information about the coin-dev mailing list