On Fri, 20 Aug 2010 02:22:56 +, dsimcha wrote:
As I mentioned buried deep in another thread, std.string is in serious
need of fixing, for two reasons:
1. Most of it doesn't work with UTF-16/UTF-32 strings.
2. Much of it requires the input to be immutable even when there's no
good
On Monday 23 August 2010 23:16:25 Michael Rynn wrote:
The problems are combinatorial, because of encoding schemes.
I imagine that when someone wants a function that is missing from
std.string, they might write one, and might even add to it.
A lot of functions in Phobos are templated on string
On 20/08/10 03:22, dsimcha wrote:
3. Is there any good reason to avoid just templating everything to work with
all 9 string types (mutable/const/immutable char/wchar/dchar[]) or whatever
subset is reasonable for the given function?
Wouldn't it be sufficient to take const as input? IIRC, both
Norbert Nemec norb...@nemec-online.de wrote:
On 20/08/10 03:22, dsimcha wrote:
3. Is there any good reason to avoid just templating everything to
work with
all 9 string types (mutable/const/immutable char/wchar/dchar[]) or
whatever
subset is reasonable for the given function?
Wouldn't
On Fri, 2010-08-20 at 02:22 +, dsimcha wrote:
[ . . . ]
1. How did it get to be this way? Why did it seem like a good idea at the
time to only support UTF-8 and only immutable strings?
But isn't the thinking these days that immutable strings are a good
thing?
Immutability is generally a
There's also this in std.string which requires a fix :
http://d.puremagic.com/issues/show_bug.cgi?id=4673
Russel Winder wrote:
On Fri, 2010-08-20 at 02:22 +, dsimcha wrote:
[ . . . ]
1. How did it get to be this way? Why did it seem like a good idea at the
time to only support UTF-8 and only immutable strings?
But isn't the thinking these days that immutable strings are a good
thing?
Ezneh wrote:
There's also this in std.string which requires a fix :
http://d.puremagic.com/issues/show_bug.cgi?id=4673
Sure. On the face of it, I think isNumeric is a silly function because
the effort expended on doing a good prediction is almost the same as
doing the actual conversion - so
On Thursday 19 August 2010 23:27:33 Russel Winder wrote:
On Fri, 2010-08-20 at 02:22 +, dsimcha wrote:
[ . . . ]
1. How did it get to be this way? Why did it seem like a good idea at
the time to only support UTF-8 and only immutable strings?
But isn't the thinking these days that
Andrei Alexandrescu:
Sure. On the face of it, I think isNumeric is a silly function because
the effort expended on doing a good prediction is almost the same as
doing the actual conversion - so why not just try it.
The difference is that a well designed isNumeric doesn't need to use
On 08/20/2010 07:21 AM, bearophile wrote:
Andrei Alexandrescu:
Sure. On the face of it, I think isNumeric is a silly function because
the effort expended on doing a good prediction is almost the same as
doing the actual conversion - so why not just try it.
The difference is that a well
bearophile Wrote:
The difference is that a well designed isNumeric doesn't need to use
exceptions,
A possible design is to use only one template function, like:
private auto _realConvert(bool useExepions)(string txt) {
...
if (some_error_condition) {
static if (useExcepions)
Andrei Alexandrescu Wrote:
I guess
return collectException(to!real(input)) is null;
should be a fine replacement for isNumeric.
Andrei
I found another way to improve the isNumeric function.
I'm doing it with a (ugly) regular expression but it works very well but maybe
we
As I mentioned buried deep in another thread, std.string is in serious need of
fixing, for two reasons:
1. Most of it doesn't work with UTF-16/UTF-32 strings.
2. Much of it requires the input to be immutable even when there's no good
reason for this constraint.
I'm trying to understand a few
On 08/19/2010 09:22 PM, dsimcha wrote:
As I mentioned buried deep in another thread, std.string is in serious need of
fixing, for two reasons:
1. Most of it doesn't work with UTF-16/UTF-32 strings.
2. Much of it requires the input to be immutable even when there's no good
reason for this
15 matches
Mail list logo