digitalmars.D.learn - hex strings
- Ellery Newcomer (3/3) Jan 26 2011 just out of curiosity, does anyone use these and actually mean them to
- Jonathan M Davis (6/10) Jan 26 2011 That's legal? I thought that x went in front of hex literals, not string...
- bearophile (5/6) Jan 26 2011 They are a part of D language, search for "Hex Strings" here:
- Jonathan M Davis (4/9) Jan 26 2011 It always seems like there's at least one more thing in the language tha...
- Ellery Newcomer (2/11) Jan 26 2011 helps to have written a D lexer or two. weren't you going to do that?
- Jonathan M Davis (6/20) Jan 26 2011 I've been working on it off and on, but I've been busy enough that I hav...
- Simen kjaeraas (6/9) Jan 26 2011 Never used them, tbh. But shouldn't that be
- Ellery Newcomer (3/11) Jan 26 2011 yeah, strictly speaking. but that (or cast(immutable(ubyte[]))) would be...
- bearophile (4/9) Jan 26 2011 Maybe it's to avoid such mistakes that C++ has const_cast separated from...
- spir (13/16) Jan 26 2011 Super-nice for universal text. Anything you can't type in because of
- Simen kjaeraas (4/7) Jan 26 2011 I like having the ability to embed #'s in my strings, thank you.
- Ellery Newcomer (3/16) Jan 26 2011 personally, I always use \uxxxx or \Uxxxxxxxx [and then print it out to
just out of curiosity, does anyone use these and actually mean them to be strings? It seems like I'm invariably writing cast(ubyte[]) x"..."
Jan 26 2011
On Wednesday, January 26, 2011 10:25:29 Ellery Newcomer wrote:just out of curiosity, does anyone use these and actually mean them to be strings? It seems like I'm invariably writing cast(ubyte[]) x"..."That's legal? I thought that x went in front of hex literals, not strings. I wouldn't have thought that that code would compile, and I certainly have no clue what you're trying to do. So, I certainly don't fall in the category of anyone using it - regardless of whether it's meant to be a string or not. - Jonathan M Davis
Jan 26 2011
Jonathan M Davis:That's legal?They are a part of D language, search for "Hex Strings" here: http://www.digitalmars.com/d/2.0/lex.html Bye, bearophile
Jan 26 2011
On Wednesday, January 26, 2011 11:29:59 bearophile wrote:Jonathan M Davis:It always seems like there's at least one more thing in the language that I have no idea is there... - Jonathan M DavisThat's legal?They are a part of D language, search for "Hex Strings" here: http://www.digitalmars.com/d/2.0/lex.html
Jan 26 2011
On 01/26/2011 01:35 PM, Jonathan M Davis wrote:On Wednesday, January 26, 2011 11:29:59 bearophile wrote:helps to have written a D lexer or two. weren't you going to do that?Jonathan M Davis:It always seems like there's at least one more thing in the language that I have no idea is there... - Jonathan M DavisThat's legal?They are a part of D language, search for "Hex Strings" here: http://www.digitalmars.com/d/2.0/lex.html
Jan 26 2011
On Wednesday 26 January 2011 11:53:32 Ellery Newcomer wrote:On 01/26/2011 01:35 PM, Jonathan M Davis wrote:I've been working on it off and on, but I've been busy enough that I haven't made as much progress on it as I'd like. Even so though, I might have already run into it there and totally forgot about it, because it's a feature that I've never used and have no use for. - Jonathan M DavisOn Wednesday, January 26, 2011 11:29:59 bearophile wrote:helps to have written a D lexer or two. weren't you going to do that?Jonathan M Davis:It always seems like there's at least one more thing in the language that I have no idea is there... - Jonathan M DavisThat's legal?They are a part of D language, search for "Hex Strings" here: http://www.digitalmars.com/d/2.0/lex.html
Jan 26 2011
Ellery Newcomer <ellery-newcomer utulsa.edu> wrote:just out of curiosity, does anyone use these and actually mean them to be strings? It seems like I'm invariably writing cast(ubyte[]) x"..."Never used them, tbh. But shouldn't that be cast(ubyte[]) x"...".dup ? -- Simen
Jan 26 2011
On 01/26/2011 02:16 PM, Simen kjaeraas wrote:Ellery Newcomer <ellery-newcomer utulsa.edu> wrote:yeah, strictly speaking. but that (or cast(immutable(ubyte[]))) would be even uglier.just out of curiosity, does anyone use these and actually mean them to be strings? It seems like I'm invariably writing cast(ubyte[]) x"..."Never used them, tbh. But shouldn't that be cast(ubyte[]) x"...".dup ?
Jan 26 2011
Simen kjaeraas:Maybe it's to avoid such mistakes that C++ has const_cast separated from other casts. Bye, bearophilecast(ubyte[]) x"..."Never used them, tbh. But shouldn't that be cast(ubyte[]) x"...".dup
Jan 26 2011
On 01/26/2011 07:25 PM, Ellery Newcomer wrote:just out of curiosity, does anyone use these and actually mean them to be strings? It seems like I'm invariably writing cast(ubyte[]) x"..."Super-nice for universal text. Anything you can't type in because of non-illimited keyboard size... a prefix: "#xx Adds one char compared to D syntax, but allows partially hex-coded string: "blah #xx Denis -- _________________ vita es estrany spir.wikidot.com
Jan 26 2011
spir <denis.spir gmail.com> wrote:Adds one char compared to D syntax, but allows partially hex-coded string: "blah #xx-- Simen
Jan 26 2011
On 01/26/2011 05:57 PM, spir wrote:On 01/26/2011 07:25 PM, Ellery Newcomer wrote:personally, I always use \uxxxx or \Uxxxxxxxx [and then print it out to the console, copy it, and paste it back into my code]just out of curiosity, does anyone use these and actually mean them to be strings? It seems like I'm invariably writing cast(ubyte[]) x"..."Super-nice for universal text. Anything you can't type in because of non-illimited keyboard size... instead of a prefix: "#xx Adds one char compared to D syntax, but allows partially hex-coded string: "blah #xx Denis
Jan 26 2011