diff --git a/std/concurrency.d b/std/concurrency.d index 43b5b629b..220ef41b2 100644 --- a/std/concurrency.d +++ b/std/concurrency.d @@ -743,13 +743,6 @@ unittest assert(result == "Unexpected message type: expected 'string', got 'int'"); } -//Explicitly undocumented. Do not use. To be removed in March 2013. -deprecated("Please use the overload of receiveTimeout which takes a Duration.") -bool receiveTimeout(T...)( long ms, T ops ) -{ - return receiveTimeout( dur!"msecs"( ms ), ops ); -} - /++ Same as $(D receive) except that rather than wait forever for a message, it waits until either it receives a message or the given diff --git a/std/conv.d b/std/conv.d index c91050088..e73687384 100644 --- a/std/conv.d +++ b/std/conv.d @@ -452,25 +452,6 @@ unittest assert(to!string(test) == test); } -//Explicitly undocumented. Do not use. To be removed in March 2013. -deprecated T toImpl(T, S)(S value) - if (is(S : Object) && !is(T : Object) && !isSomeString!T && - hasMember!(S, "to") && is(typeof(S.init.to!T()) : T)) -{ - return value.to!T(); -} - -unittest -{ - debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); - class B - { - T to(T)() { return 43; } - } - auto b = new B; - assert(to!int(b) == 43); -} - /** When source type supports member template function opCast, is is used. */ diff --git a/std/datetime.d b/std/datetime.d index 7ff85a222..320d21a87 100644 --- a/std/datetime.d +++ b/std/datetime.d @@ -7389,12 +7389,6 @@ assert(SysTime(DateTime(2000, 6, 4, 12, 22, 9)).daysInMonth == 30); return Date(dayOfGregorianCal).daysInMonth; } - //Explicitly undocumented. Do not use. To be removed in March 2013. - deprecated("Please use daysInMonth instead.") @property ubyte endOfMonthDay() const nothrow - { - return Date(dayOfGregorianCal).daysInMonth; - } - unittest { version(testStdDateTime) @@ -12504,12 +12498,6 @@ assert(Date(2000, 6, 4).daysInMonth == 30); return maxDay(_year, _month); } - //Explicitly undocumented. Do not use. To be removed in March 2013. - deprecated("Please use daysInMonth instead.") @property ubyte endOfMonthDay() const nothrow - { - return maxDay(_year, _month); - } - unittest { version(testStdDateTime) @@ -17394,12 +17382,6 @@ assert(DateTime(Date(2000, 6, 4), TimeOfDay(12, 22, 9)).daysInMonth == 30); return _date.daysInMonth; } - //Explicitly undocumented. Do not use. To be removed in March 2013. - deprecated("Please use daysInMonth instead.") @property ubyte endOfMonthDay() const nothrow - { - return _date.daysInMonth; - } - unittest { version(testStdDateTime) diff --git a/std/string.d b/std/string.d index 53a3fd4f1..660d85a7a 100644 --- a/std/string.d +++ b/std/string.d @@ -67,26 +67,6 @@ class StringException : Exception } } -/* ************* Constants *************** */ - -//Explicitly undocumented. Do not use. To be removed in March 2013. -deprecated("Please use std.ascii.hexDigits instead.") immutable char[16] hexdigits = "0123456789ABCDEF"; -deprecated("Please use std.ascii.digits instead.") immutable digits = "0123456789"; -deprecated("Please use std.ascii.octalDigits instead.") immutable char[8] octdigits = "01234567"; -deprecated("Please use std.ascii.lowercase instead.") immutable char[26] lowercase = "abcdefghijklmnopqrstuvwxyz"; -deprecated("Please use std.ascii.letters instead.") immutable char[52] letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; -deprecated("Please use std.ascii.uppercase instead.") immutable char[26] uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; -deprecated("Please use std.ascii.whitespace instead.") alias std.ascii.whitespace whitespace; -deprecated("Please use std.uni.lineSep instead.") enum dchar LS = '\u2028'; -deprecated("Please use std.uni.paraSep instead.") enum dchar PS = '\u2029'; -deprecated("Please use std.ascii.newline instead.") alias std.ascii.newline newline; -deprecated("Please use std.uni.isWhite instead.") bool iswhite(dchar c) -{ - return c <= 0x7F - ? indexOf(whitespace, c) != -1 - : (c == paraSep || c == lineSep); -} - /++ Compares two ranges of characters lexicographically. The comparison is @@ -759,12 +739,6 @@ unittest } -//Explicitly undocumented. Do not use. To be removed in March 2013. -deprecated("Please use std.string.toLower instead.") S tolower(S)(S s) if (isSomeString!S) -{ - return toLower!S(s); -} - /++ Returns a string which is identical to $(D s) except that all of its characters are lowercase (in unicode, not just ASCII). If $(D s) does not @@ -812,12 +786,6 @@ unittest } } -//Explicitly undocumented. Do not use. To be removed in March 2013. -deprecated("Please use std.string.toLowerInPlace instead.") void tolowerInPlace(C)(ref C[] s) if (isSomeChar!C) -{ - toLowerInPlace!C(s); -} - /++ Converts $(D s) to lowercase (in unicode, not just ASCII) in place. If $(D s) does not have any uppercase characters, then $(D s) is unaltered. @@ -922,11 +890,6 @@ unittest assert(toLower("Some String"d) == "some string"d); } -//Explicitly undocumented. Do not use. To be removed in March 2013. -deprecated("Please use std.string.toUpper instead.") S toupper(S)(S s) if (isSomeString!S) -{ - return toUpper!S(s); -} /++ Returns a string which is identical to $(D s) except that all of its @@ -975,12 +938,6 @@ unittest } } -//Explicitly undocumented. Do not use. To be removed in March 2013. -deprecated("Please use std.string.toUpperInPlace instead.") void toupperInPlace(C)(ref C[] s) if (isSomeChar!C) -{ - toUpperInPlace!C(s); -} - /++ Converts $(D s) to uppercase (in unicode, not just ASCII) in place. If $(D s) does not have any lowercase characters, then $(D s) is unaltered. @@ -1149,74 +1106,6 @@ unittest } -//Explicitly undocumented. Do not use. To be removed in March 2013. -deprecated S capwords(S)(S s) if (isSomeString!S) -{ - alias typeof(s[0]) C; - auto retval = appender!(C[])(); - bool inWord = false; - size_t wordStart = 0; - - foreach(i, dchar c; s) - { - if(std.uni.isWhite(s[i])) - { - if(inWord) - { - retval.put(capitalize(s[wordStart .. i])); - inWord = false; - } - } - else if(!inWord) - { - if(!retval.data.empty) - retval.put(' '); - - wordStart = i; - inWord = true; - } - } - - if(inWord) - retval.put(capitalize(s[wordStart .. $])); - - return cast(S)retval.data; -} - -deprecated unittest -{ - debug(string) printf("string.capwords.unittest\n"); - - foreach (S; TypeTuple!(string, wstring, dstring, char[], wchar[], dchar[])) - { - auto s1 = to!S("\tfoo abc(aD)* \t (q PTT "); - S s2; - - s2 = capwords(s1); - assert(cmp(s2, "Foo Abc(ad)* (q Ptt") == 0); - - s1 = to!S("\u0430\u0411\u0544 \uFF48elLO\u00A0\u0131\u0053\u0049\u017F " ~ - "\u017F\u0053\u0131\u0130"); - s2 = capwords(s1); - assert(cmp(s2, "\u0410\u0431\u0574 \uFF28ello\u00A0\u0049\u0073\u0069\u017F " ~ - "\u0053\u0053\u0131\u0069")); - } -} - - -//Explicitly undocumented. Do not use. To be removed in March 2013. -deprecated("Please use std.array.replicate instead.") S repeat(S)(S s, size_t n) -{ - return std.array.replicate(s, n); -} - - -//Explicitly undocumented. Do not use. To be removed in March 2013. -deprecated("Please use std.string.splitLines instead.") S[] splitlines(S)(S s) -{ - return splitLines!S(s); -} - /++ Split $(D s) into an array of lines using $(D '\r'), $(D '\n'), $(D "\r\n"), $(XREF uni, lineSep), and $(XREF uni, paraSep) as delimiters. @@ -1307,12 +1196,6 @@ unittest } -//Explicitly undocumented. Do not use. To be removed in March 2013. -deprecated("Please use std.string.stripLeft instead.") String stripl(String)(String s) -{ - return stripLeft!String(s); -} - /++ Strips leading whitespace. @@ -1358,12 +1241,6 @@ unittest } -//Explicitly undocumented. Do not use. To be removed in March 2013. -deprecated("Please use std.string.stripRight instead.") String stripr(String)(String s) -{ - return stripRight!String(s); -} - /++ Strips trailing whitespace. @@ -1755,12 +1632,6 @@ unittest } -//Explicitly undocumented. Do not use. To be removed in March 2013. -deprecated("Please use std.string.leftJustify instead.") S ljustify(S)(S s, size_t width) if (isSomeString!S) -{ - return leftJustify!S(s, width); -} - /++ Left justify $(D s) in a field $(D width) characters wide. $(D fillChar) is the character that will be used to fill up the space in the field that @@ -1796,12 +1667,6 @@ S leftJustify(S)(S s, size_t width, dchar fillChar = ' ') @trusted } -//Explicitly undocumented. Do not use. To be removed in March 2013. -deprecated("Please use std.string.rightJustify instead.") S rjustify(S)(S s, size_t width) if (isSomeString!S) -{ - return rightJustify!S(s, width); -} - /++ Right justify $(D s) in a field $(D width) characters wide. $(D fillChar) is the character that will be used to fill up the space in the field that @@ -1902,33 +1767,6 @@ unittest } -//Explicitly undocumented. Do not use. To be removed in March 2013. -deprecated("Please use std.string.rightJustify with a fill character of '0' instead.") -S zfill(S)(S s, int width) if (isSomeString!S) -{ - return rightJustify!S(s, width, '0'); -} - - -//Explicitly undocumented. Do not use. To be removed in March 2013. -deprecated("Please use std.array.insertInPlace instead.") S insert(S)(S s, size_t index, S sub) -in -{ - assert(0 <= index && index <= s.length); -} -body -{ - std.array.insertInPlace(s, index, sub); - return s; -} - - -//Explicitly undocumented. Do not use. To be removed in March 2013. -deprecated("Please use std.string.detab instead.") S expandtabs(S)(S str, size_t tabsize = 8) if (isSomeString!S) -{ - return detab!S(str, tabsize); -} - /++ Replace each tab character in $(D s) with the number of spaces necessary to align the following character at the next tab stop where $(D tabSize) @@ -2483,28 +2321,6 @@ unittest } -//Explicitly undocumented. Do not use. To be removed in March 2013. -deprecated("Please use std.string.makeTrans instead.") alias makeTrans maketrans; - -deprecated unittest -{ - debug(string) printf("string.translate.unittest\n"); - - string from = "abcdef"; - string to = "ABCDEF"; - string s = "The quick dog fox"; - string t; - string r; - int i; - - t = maketrans(from, to); - r = translate(s, t, "kg"); - //printf("r = '%.*s'\n", r); - i = cmp(r, "ThE quiC Do Fox"); - assert(i == 0); -} - - /***************************************************** * Format arguments into a string. * @@ -3516,97 +3332,6 @@ bool isNumeric(const(char)[] s, in bool bAllowSep = false) return true; } -//Explicitly undocumented. Do not use. To be removed in March 2013. -deprecated bool isNumeric(...) -{ - return isNumeric(_arguments, _argptr); -} - -//Explicitly undocumented. Do not use. To be removed in March 2013. -deprecated bool isNumeric(TypeInfo[] _arguments, va_list _argptr) -{ - auto s = ""c; - auto ws = ""w; - auto ds = ""d; - - //writefln("isNumeric(...) called!"); - if (_arguments.length == 0) - return false; - - if (_arguments[0] == typeid(char[])) - return isNumeric(va_arg!(char[])(_argptr)); - else if (_arguments[0] == typeid(wchar[])) - return isNumeric(std.utf.toUTF8(va_arg!(wchar[])(_argptr))); - else if (_arguments[0] == typeid(dchar[])) - return isNumeric(std.utf.toUTF8(va_arg!(dstring)(_argptr))); - else if (_arguments[0] == typeid(real)) - return true; - else if (_arguments[0] == typeid(double)) - return true; - else if (_arguments[0] == typeid(float)) - return true; - else if (_arguments[0] == typeid(ulong)) - return true; - else if (_arguments[0] == typeid(long)) - return true; - else if (_arguments[0] == typeid(uint)) - return true; - else if (_arguments[0] == typeid(int)) - return true; - else if (_arguments[0] == typeid(ushort)) - return true; - else if (_arguments[0] == typeid(short)) - return true; - else if (_arguments[0] == typeid(ubyte)) - { - char[1] t; - t[0]= va_arg!(ubyte)(_argptr); - return isNumeric(cast(string)t); - } - else if (_arguments[0] == typeid(byte)) - { - char[1] t; - t[0] = va_arg!(char)(_argptr); - return isNumeric(cast(string)t); - } - else if (_arguments[0] == typeid(ireal)) - return true; - else if (_arguments[0] == typeid(idouble)) - return true; - else if (_arguments[0] == typeid(ifloat)) - return true; - else if (_arguments[0] == typeid(creal)) - return true; - else if (_arguments[0] == typeid(cdouble)) - return true; - else if (_arguments[0] == typeid(cfloat)) - return true; - else if (_arguments[0] == typeid(char)) - { - char[1] t; - t[0] = va_arg!(char)(_argptr); - return isNumeric(cast(string)t); - } - else if (_arguments[0] == typeid(wchar)) - { - wchar[1] t; - t[0] = va_arg!(wchar)(_argptr); - return isNumeric(std.utf.toUTF8(t)); - } - else if (_arguments[0] == typeid(dchar)) - { - dchar[1] t; - t[0] = va_arg!(dchar)(_argptr); - dchar[] t1 = t; - return isNumeric(std.utf.toUTF8(cast(dstring) t1)); - } - //else if (_arguments[0] == typeid(cent)) - // return true; - //else if (_arguments[0] == typeid(ucent)) - // return true; - else - return false; -} unittest { @@ -3648,22 +3373,6 @@ unittest assert(isNumeric(s[0..s.length - 1]) == false); } -deprecated unittest -{ - // These test calling the isNumeric(...) function - assert(isNumeric(1,123UL) == true); - assert(isNumeric('2') == true); - assert(isNumeric('x') == false); - assert(isNumeric(cast(byte)0x57) == false); // 'W' - assert(isNumeric(cast(byte)0x37) == true); // '7' - assert(isNumeric(cast(wchar[])"145.67") == true); - assert(isNumeric(cast(dchar[])"145.67U") == false); - assert(isNumeric(123_000.23fi) == true); - assert(isNumeric(123.00E-5+1234.45E-12Li) == true); - assert(isNumeric(real.nan) == true); - assert(isNumeric(-real.infinity) == true); -} - /***************************** * Soundex algorithm. diff --git a/std/uni.d b/std/uni.d index 8b90ed233..625750017 100644 --- a/std/uni.d +++ b/std/uni.d @@ -44,12 +44,6 @@ bool isWhite(dchar c) @safe pure nothrow } -//Explicitly undocumented. Do not use. To be removed in March 2013. -deprecated("Please use std.uni.isLower instead.") bool isUniLower(dchar c) @safe pure nothrow -{ - return isLower(c); -} - /++ Return whether $(D c) is a Unicode lowercase character. +/ @@ -62,12 +56,6 @@ bool isLower(dchar c) @safe pure nothrow } -//Explicitly undocumented. Do not use. To be removed in March 2013. -deprecated("Please use std.uni.isUpper instead.") bool isUniUpper(dchar c) @safe pure nothrow -{ - return isUpper(c); -} - /++ Return whether $(D c) is a Unicode uppercase character. +/ @@ -80,12 +68,6 @@ bool isUpper(dchar c) @safe pure nothrow } -//Explicitly undocumented. Do not use. To be removed in March 2013. -deprecated("Please use std.uni.toLower instead.") dchar toUniLower(dchar c) @safe pure nothrow -{ - return toLower(c); -} - /++ If $(D c) is a Unicode uppercase character, then its lowercase equivalent is returned. Otherwise $(D c) is returned. @@ -146,12 +128,6 @@ dchar toLower(dchar c) @safe pure nothrow } -//Explicitly undocumented. Do not use. To be removed in March 2013. -deprecated("Please use std.uni.toUpper instead.") dchar toUniUpper(dchar c) @safe pure nothrow -{ - return toUpper(c); -} - /++ If $(D c) is a Unicode lowercase character, then its uppercase equivalent is returned. Otherwise $(D c) is returned. @@ -212,12 +188,6 @@ dchar toUpper(dchar c) @safe pure nothrow } -//Explicitly undocumented. Do not use. To be removed in March 2013. -deprecated("Please use std.uni.isAlpha instead.") bool isUniAlpha(dchar c) @safe pure nothrow -{ - return isAlpha(c); -} - /++ Returns whether $(D c) is a Unicode alpha character (general Unicode category: Lu, Ll, Lt, Lm, and Lo). diff --git a/unittest.d b/unittest.d index 6da374fcc..4a84d3435 100644 --- a/unittest.d +++ b/unittest.d @@ -91,9 +91,9 @@ else Clock.currTime(); // datetime Exception e = new ReadException(""); // stream din.eof(); // cstream - isValidDchar(cast(dchar)0); // utf - std.uri.ascii2hex(0); // uri - std.zlib.adler32(0,null); // D.zlib + isValidDchar(cast(dchar)0); // utf + std.uri.ascii2hex(0); // uri + std.zlib.adler32(0,null); // D.zlib auto t = task!cmp("foo", "bar"); // parallelism ubyte[16] buf; @@ -122,7 +122,7 @@ else std.demangle.demangle("hello"); - std.uni.isUniAlpha('A'); + std.uni.isAlpha('A'); std.file.exists("foo");