Hacker News new | ask | show | jobs
by cpurdy 1253 days ago
It's an interesting mix of "hex" and "array" into one syntactic composition. I do kind-of like it.

Here's how we ended up supporting byte strings (# prefix) in Ecstasy, in this case multi-line:

    Byte[] bytes = #|12 34 56
                    |78 9a BC
                    |dE f0
                   ;

    console.println($|bytes=
                     |{bytes.toHexDump(4)}
                   );
Which prints:

  bytes=
  00: 12 34 56 78 .4Vx
  04: 9A BC DE F0 .¼Þð