[Issue 9621] std.conv.parseEscape fails on octals and named

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Mar 1 04:50:58 PST 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9621



--- Comment #7 from monarchdodra at gmail.com 2013-03-01 04:50:56 PST ---
(In reply to comment #4)
> I thought std.conv.parse goal was closer to sscanf of C. In other words that
> it's a backbone behind the formattedRead, readf etc.

I guess the whole discussion boils down to rather "what should/does
formattedRead" accept then? Given the fact that it is "higher order" and
capable of parsing arrays of stuff, what happens what it parses a string that
represents an array of strings?

I mean, imagine this program:
string s1 = ...
string s2[];
formattedRead(s1, "%s", &s2);

The question is: What are legal s1 values?

s1 = `["a", "b"]`;     => ["a", "b"]
s1 = `["a", "b", ]`;   => ["a", "b"] (1)
s1 = `["ab", ['a', 'b']]` => ["ab", "ab"]
s1 = `["\t", "\n"]`;   => ["\t", "\n"]
s1 = `["\0"]`;         => ["\0"] (2)
s1 = `["\141"]`;       => ["a"]
s1 = `["\x61"]`;       => ["a"]
s1 = `["\u0061"]`;     => ["a"]
s1 = `["\U00000061"]`; => ["a"]
s1 = `["\&"]`;     => ["&"] (3)

(1) //Not currently supported
(2) //Not currently supported
(3) //Not currently supported

Unless formatted read can document what it can(should) and doesn't support,
we'll just run around in circles...

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list