Regarding hex strings

H. S. Teoh hsteoh at quickfur.ath.cx
Mon Oct 22 09:38:00 PDT 2012


On Mon, Oct 22, 2012 at 01:14:21PM +0200, Dejan Lekic wrote:
> >
> >If you want vastly human readable, you want heredoc hex syntax,
> >something like this:
> >
> >	ubyte[] = x"<<END
> >	32 2b 32 3d 34 2e 20 32 2a 32 3d 34 2e 20 32 5e
> >	32 3d 34 2e 20 54 68 65 72 65 66 6f 72 65 2c 20
> >	2b 2c 20 2a 2c 20 61 6e 64 20 5e 20 61 72 65 20
> >	74 68 65 20 73 61 6d 65 20 6f 70 65 72 61 74 69
> >	6f 6e 2e 0a 22 36 34 30 4b 20 6f 75 67 68 74 20
> >	74 6f 20 62 65 20 65 6e 6f 75 67 68 22 20 2d 2d
> >	20 42 69 6c 6c 20 47 2e 2c 20 31 39 38 34 2e 20
> >	22 54 68 65 20 49 6e 74 65 72 6e 65 74 20 69 73
> >	20 6e 6f 74 20 61 20 70 72 69 6d 61 72 79 20 67
> >	6f 61 6c 20 66 6f 72 20 50 43 20 75 73 61 67 65
> >	END";
> >
> 
> Having a heredoc syntax for hex-strings that produce ubyte[] arrays
> is confusing for people who would (naturally) expect a string from a
> heredoc string. It is not named hereDOC for no reason. :)

What I meant was, a syntax similar to heredoc, not an actual heredoc,
which would be a string.


T

-- 
Knowledge is that area of ignorance that we arrange and classify. -- Ambrose Bierce


More information about the Digitalmars-d mailing list