[phobos] Deprecation of std.regexp

Jonathan M Davis jmdavisProg at gmx.com
Sun Jun 5 01:13:08 PDT 2011


On 2011-06-05 00:56, Brad Roberts wrote:
> On 6/5/2011 12:52 AM, Jonathan M Davis wrote:
> > It looks like std.regexp was marked in its documentation as deprecated in
> > 2.053. It was not actually deprecated (the deprecation modifier is
> > missing), but if it has indeed been deprecated (and std.regex has been
> > around for a while, so it's not exactly a surprise), then it needs to
> > actually be deprecated, and the rest of Phobos needs to be using
> > std.regex instead. I can easily deprecate the function (after all, all
> > you have to do is add deprecated: near the top of the file), but since
> > I've never used either of the regex modules, I'm ill-suited to convert
> > the rest of Phobos to use std.regex. So, I'd appreciate it if someone
> > who is actually familiar with the two modules would convert the rest of
> > Phobos to use std.regex sometime prior to the next release, and then we
> > can actually deprecate std.regexp. Worse comes to worst, I can take a
> > crack at it, but it would be much faster if someone who's familiar with
> > the regex modules did it.
> > 
> > Now, we may actually want to change std.regexp to "scheduled for
> > deprecation" rather than deprecated simply because there are other
> > functions in Phobos which take stuff from std.regexp but not std.regex
> > (such as the version of std.file.listdir which takes a RegExp) have not
> > yet been scheduled for deprecation, let alone deprecated, but
> > regardless, we need to change the rest of Phobos to use std.regex or we
> > won't be able to actually deprecate and remove std.regexp (well, I
> > suppose that we _could_ deprecate it as-is, but it seems to me to be a
> > bad idea to deprecate something when Phobos is still using it in its API
> > elsewhere).
> > 
> > - Jonathan M Davis
> 
> It was marked deprecated once (check out the blame history of the file),
> but that was reverted since commonly used modules still use it.  The
> effect would be that essentially every app would need to be compiled with
> -d, which is hardly useful.  Until phobos doesn't use it, no real
> deprecation can actually occur.

That's essentially my point. Someone needs to convert the rest of Phobos so 
that it uses std.regex instead of std.regexp before we can properly deprecate 
std.regexp (and given all of the stuff in Phobos which still uses std.regexp, 
we should probably make it so that std.regexp is _scheduled_ for deprecation 
rather than deprecated, but the changes still need to be made). Simply marking 
std.regexp as deprecated in its documentation isn't enough. I'm raising the 
issue so that someone who is actually familiar with std.regexp and std.regex 
can do the conversion.

- Jonathan M Davis


More information about the phobos mailing list