[Issue 1630] Few suggestions for std.conv (D language 2.0)
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Oct 31 10:02:32 PDT 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1630
------- Comment #1 from andrei at metalanguage.com 2007-10-31 12:02 -------
1. parse() is meant to use known-in-advance data formats; a function closer to
what you mention is string.munch. An obvious addition will be to allow munch
with a regex, which is exactly what you mention.
2. to!(T) also has a more limited charter. Converting strings to arrays was not
considered appropriate for implementing at this level because there are so many
options (e.g., having the size prefix the string, various quoting mechanisms
etc.) that any particular design would have been too constraining. Some
higher-level, more abstract serialization ideas would be welcome. to!(T) does
not seem like the right level.
3. A Perl-like quotemeta function does indeed belong to the standard library
(probably in the string module though).
4. This is a bit vague. Adding a full-blown serialization solution is
worthwhile, but it will take some time. The to!(T) and parse!(T) families of
functions are only meant as backends for such a framework, not parts of its
architecture.
--
More information about the Digitalmars-d-bugs
mailing list