Commit graph

282 commits

Author SHA1 Message Date
jmdavis
73283a87f2 Fix test compilation error on 64-bit. 2011-06-04 23:22:48 -07:00
andralex
5b5ec9651c Fix unlisted bug in splitter revealed by TDPL example on page 8 2011-06-04 17:04:30 -05:00
jmdavis
b30a18a700 Adjustments to unit tests to reduce memory consumption. 2011-06-03 00:16:13 -07:00
jmdavis
d043103cde Fixed startsWith and endsWith with regards to the default predicate and strings.
I also fixed std.string.icmp and std.algorithm.cmp, since they had
incorrect code for checking the default predicate.
2011-06-02 21:42:24 -07:00
dsimcha
0a40daaead Optimize std.algorithm.sort: Round 2. 2011-06-02 22:20:25 -04:00
jmdavis
37c6a9313a Fixed formatting and tweaked some unit tests.
I also updated the documentation of find and startsWith to be clearer
about what it does in the case where multiple arguments match.
2011-05-31 23:28:32 -07:00
jmdavis
126e255a6b asnetha 2011-05-30 21:21:01 -07:00
jmdavis
fcb672f55f Improved startsWith and endsWith.
1. startsWith and endsWith now have similar implementations.

2. They work with strings of different character sizes, whereas before
they treated strings as arrays regardless of whether they had the same
character size or not.

3. endsWith now actually works when mixing ranges and elements in the
endsWith portion like the documentation claims it does.
2011-05-30 04:13:27 -07:00
Andrej Mitrovic
0a073786ba Fixed code sample for std.algorithm.remove. 2011-05-24 20:26:08 +02:00
Andrei Alexandrescu
d1d81245ea Merge pull request #49 from kyllingstad/joiner-input-range
std.algorithm.joiner() should only require an input range
2011-05-16 07:12:10 -07:00
Lars T. Kyllingstad
c15062b1e8 Unittest for joiner() with non-forward range 2011-05-16 16:02:28 +02:00
Lars T. Kyllingstad
ae3cea46fd joiner() should only require an input range
The template constraint for std.algorithm.joiner(r, sep) required a
forward range, when an input range would suffice.  The one-argument
version of joiner() did not have this problem.
2011-05-16 15:49:22 +02:00
Lars T. Kyllingstad
dc352eaec9 Only define Until.save() forward ranges
std.algorithm.Until.save() was defined for all ranges, but should only
be defined when the underlying range is a forward range.
2011-05-16 15:36:01 +02:00
k-hara
b5e1dc36ef Added unittests for issue 5661. 2011-05-06 01:43:16 +09:00
k-hara
fe90698c78 Issue 5661 - std.algorithm.move does not work on elaborate struct 2011-05-06 01:38:24 +09:00
dsimcha
fc3d63612d Work around GDC's wrongness w.r.t. function argument evaluation order. 2011-04-27 20:33:22 -04:00
andralex
e9c639d1ff Merge branch 'master' of https://github.com/torarin/phobos into testing-pull-request 2011-04-25 00:52:15 -05:00
Don Clugston
ca64cc2878 Trivial fix for broken algorithm.d unittest
In the existing compiler, using 'new int' inside a struct static initializer
is silently ignored.
2011-04-14 15:56:14 +08:00
torarin
ec2c8460a6 Replaced foreach loop in std.algorithm.equal with a for loop that calls popFront on both ranges. This ensures that code points are not compared with code units in conjunction with narrow strings. 2011-04-12 16:39:35 -07:00
Don Clugston
9ffdaa9058 Fix build break with std.algorithm.sort
Although the previous commit was correct, it requires my CTFE patch which
isn't yet in DMD. This is a quick patch to restore the build.
2011-04-12 05:34:22 +08:00
David Nadlinger
858e1ce747 Out-of-bounds error in algorithm.sort assertion message. 2011-04-12 05:15:40 +08:00
David Nadlinger
516de1bd9c Fixed links to STL algorithms and HTML errors. 2011-04-06 15:54:17 +02:00
David Nadlinger
dda7f610a0 Minor algorithm cheatsheet fixes. 2011-04-06 13:03:40 +02:00
David Nadlinger
29884011ec Unified style of references in algorithm cheat sheet. 2011-04-06 12:36:33 +02:00
Andrei Alexandrescu
deebbe52c0 Fix Opera rendering issue 2011-04-05 23:54:41 -05:00
Andrei Alexandrescu
d527807016 doc fix 2011-04-05 23:36:25 -05:00
Andrei Alexandrescu
5071624851 Typo 2011-04-04 00:52:25 -05:00
Andrei Alexandrescu
3e6679b297 Improvements to std.range and std.algorithm 2011-04-04 00:44:59 -05:00
Andrei Alexandrescu
c3b7665a42 Merge branch 'work' of github.com:andralex/phobos into work
Conflicts:
	posix.mak
	std/algorithm.d
	std/conv.d
	std/datetime.d
	std/range.d
2011-02-27 15:25:59 -06:00
Andrei Alexandrescu
1083bd4e7b One pass through std.range and friends
* Made emplace faster and replaced calls to it to also make them faster.

* Replaced phobos.d in posix.mak with index.d.

* Added version=StdDdoc to documentation build in posix.mak, and replaced uses of D_Ddoc with it.

* Improved documentation target in posix.mak (target dir automatically created).

* Added nice documentation table and cheat sheet at the top of std.algorithm.

* Replaced a few helper structs in std.range and std.algorithm with local structs, which simplify matters a fair amount.

* Added more constraints to functions in std.algorithm (still work in progress).

* Improved error message in std.algorithm.sort in case of failure to sort.

* std.random.dice(1, 10) now works (no need for array notation std.random.dice([1, 10])).

* Fixed documentation bugs and insufficiencies in std.range (still more to do).

* Improved speed of walkLength.

* Simplified retro.

* Simplified and optimized stride. Also folded stride(stride(r, a), b) into stride(r, a * b).

* Added roundRobin to std.range, which as a perk simplified radial.

* Added takeOne and takeNone to std.range.

* Added unsigned to std.traits.
2011-02-27 12:38:49 -06:00
Andrei Alexandrescu
78b3f24604 One pass through std.range and friends
* Made emplace faster and replaced calls to it to also make them faster.

* Replaced phobos.d in posix.mak with index.d.

* Added version=StdDdoc to documentation build in posix.mak, and replaced uses of D_Ddoc with it.

* Improved documentation target in posix.mak (target dir automatically created).

* Added nice documentation table and cheat sheet at the top of std.algorithm.

* Replaced a few helper structs in std.range and std.algorithm with local structs, which simplify matters a fair amount.

* Added more constraints to functions in std.algorithm (still work in progress).

* Improved error message in std.algorithm.sort in case of failure to sort.

* std.random.dice(1, 10) now works (no need for array notation std.random.dice([1, 10])).

* Fixed documentation bugs and insufficiencies in std.range (still more to do).

* Improved speed of walkLength.

* Simplified retro.

* Simplified and optimized stride. Also folded stride(stride(r, a), b) into stride(r, a * b).

* Added roundRobin to std.range, which as a perk simplified radial.

* Added takeOne and takeNone to std.range.

* Added unsigned to std.traits.
2011-02-26 15:19:35 -06:00
jmdavis
1a3c750902 Merge branch 'master' of https://github.com/kyllingstad/phobos into kyllingstad-master 2011-02-09 12:08:57 -08:00
Walter Bright
046e1b36db add source links 2011-02-06 15:46:50 -08:00
Lars T. Kyllingstad
efcacab6ec Issue 2874 - phobos docs issues 2011-02-03 11:29:57 +01:00
Andrei Alexandrescu
c84f8a6a56 findSplit, findSplitBefore, findSplitAfter 2011-01-23 15:44:03 +00:00
Andrei Alexandrescu
cf8815f542 Fix for issue 4994 2011-01-22 22:20:54 +00:00
Andrei Alexandrescu
f8d1c0e71b Added findParts and takeExactly 2011-01-22 21:26:54 +00:00
Andrei Alexandrescu
272ceaa9a6 Improvements to replicate(); documented splitter() for strings; renamed replace() in place to replaceInPlace(); removed replace() that takes void* in the last position; moved replace() from string to array and generalized it; attached constraint to functional.not; more cleanup of std.string; improved std.algorithm.util and count to accept ranges; improved constraint in std.algorithm.remove 2011-01-21 08:39:39 +00:00
Jonathan M Davis
d8488a9865 Phobos has now been changed to use std.datetime. Also, bug# 3848 has been fixed.
std.gregorian, std.date, and std.dateparse have all been marked as
scheduled for deprecation. Everywhere (except for std.file) which was
using std.date is now using std.datetime. std.file is now using
std.datetime but has a number of functions still using d_time but which
are marked as scheduled for deprecation. I tried to give as many as I
could pragmas indicating that they were scheduled for deprecation, but
at the moment, that requires that a function be a templated function, and
I couldn't templatize all of them. So, some functions in std.file are
only marked as scheduled for deprecation in their documentation and will
not give any warning on compilation.

I had to rename several functions in std.file in order to avoid making
any breaking changes. And since I was already having to mess with
function names, it seemed like a good time to change the names of a
number of the functions in std.file to use proper capitalization
(such as changing isdir to isDir) as has been discussed and overwhelmingly
supported in the newsgroup with regards to std.string. And since I was
making those changes, it seemed like a good time to fix bug# 3848
(functions in std.file don't take symbolic links into account) as well.
So, std.file should now deal with symlinks properly.

The issue which Andrei brought up with +VERSION causing the std.datetime
unit tests to fail on OSX has been fixed as well.
2011-01-19 11:10:18 +00:00
Andrei Alexandrescu
331dd3a489 Moved split from string to array, made one more pass through array 2011-01-19 06:44:46 +00:00
Andrei Alexandrescu
cf33c1999a Moved join from std.string to std.array, plus a few cosmetic changes 2011-01-17 20:43:54 +00:00
Andrei Alexandrescu
a0ecf2a10e Moved cmp to std.algorithm 2011-01-17 16:46:35 +00:00
Andrei Alexandrescu
c2f018066a Changed signature of findSkip, scheduled indexOf for deprecation, removed obsolete unittests 2011-01-17 08:36:59 +00:00
Andrei Alexandrescu
b2bf0bc48c Moved count from std.string to std.algorithm, which works toward fixing 4883 2011-01-17 03:31:12 +00:00
Andrei Alexandrescu
461e22c923 Unlisted bug in levenshteinDistanceAndPath, removed spurious comment 2011-01-12 01:06:28 +00:00
Andrei Alexandrescu
0661020655 Unlisted bug in levenshteinDistanceAndPath 2011-01-12 01:05:49 +00:00
Andrei Alexandrescu
09ee12db23 Fixes for bugzilla 3313 and 5443 2011-01-11 00:50:45 +00:00
Andrei Alexandrescu
6462d38a07 http://d.puremagic.com/issues/show_bug.cgi?id=3317 2011-01-09 21:44:03 +00:00
Andrei Alexandrescu
0b876c040d Added filterBidirectional for completeness 2011-01-03 17:54:35 +00:00
Andrei Alexandrescu
825ddd564f Readded Filter unittests. Minor fix for move 2011-01-03 15:27:01 +00:00