Commit graph

138 commits

Author SHA1 Message Date
David Nadlinger
4df94e60b1 Make takeExactly(…).length for non-random-access ranges a property. 2011-08-02 22:18:41 +02:00
dsimcha
d08f0e6621 One more fix for the last pull request. It should really just take ulongs for indexing and slicing. 2011-07-12 22:06:09 -04:00
KennyTM~
95f3698bdc Oops the previous commit doesn't completely fix all possibilities for 'zip'. 2011-07-13 06:36:43 +08:00
KennyTM~
5a2add5e7a Fix bug 6301.
The following functions are modified to accept ranges with iota of longs:

 * std.algorithm.map
 * std.algorithm.splitter
 * std.range.retro
 * std.range.radial
 * std.range.popBackN
 * std.range.zip
 * std.range.iota
 * std.range.moveAt
2011-07-13 06:16:20 +08:00
Daniel Murphy
dc0beb97dc Fix unlisted bug found by implementing http://d.puremagic.com/issues/show_bug.cgi?id=5399.
InputRangeObject.popBack calls back when it should call popBack.
2011-06-30 02:39:47 +10:00
KennyTM~
252c29be22 Notice about bug 4040. 2011-06-22 14:47:45 +08:00
KennyTM~
8f7b9d0d13 Issue 5873 - Cannot call iota() on long with step 2011-06-21 16:42:44 +08:00
Andrei Alexandrescu
5a0134dd10 Fixed 672 broken links 2011-06-09 09:48:53 -05:00
dsimcha
9c7fe081f8 Fix Bug 5891 2011-05-05 18:44:15 -04:00
Andrei Alexandrescu
d061f13d34 https://github.com/D-Programming-Language/phobos/pull/23 2011-05-01 12:11:46 -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
ee3c02bbf6 Merge branch 'issue2874' into bugfixes 2011-02-03 11:33:17 +01:00
Lars T. Kyllingstad
efcacab6ec Issue 2874 - phobos docs issues 2011-02-03 11:29:57 +01:00
Lars T. Kyllingstad
3948e3f614 Fix special cases of take()
My earlier fix for issue 5052, "take!(Take!R) should return Take!R, not
Take!(Take!R)", broke David's fix for issue 4464, "std.range.take does
not always return Take!R".  This commit should fix both issues.

The special case when typeof(R.opSlice()) !=  R is now also accounted
for.
2011-02-02 13:23:54 +01:00
David Nadlinger
c056bf2687 Augmented the unittests for Zip.
I assumed that zLongest was orginially intended to test the StoppingPolicy.longest case, even though it previously had requireSameLength.
2011-01-30 23:36:12 +01:00
David Nadlinger
9e26dcfc81 Fixed Zip.empty for StoppingPolicy.longest.
Previously, it would never return true.

Fixes 5506.
2011-01-30 23:34:07 +01:00
David Nadlinger
2866365a32 Cosmetic change to zip unittests.
This only untangles two sections, no functional changes.
2011-01-30 23:16:06 +01:00
Andrei Alexandrescu
b6aabf2044 Improvements to SortedRange; added several search strategies 2011-01-27 12:06:56 -06:00
Andrei Alexandrescu
b91689dcba Short circuit type for takeExactly(takeExactly(r, n)) 2011-01-24 22:16:26 -06:00
Andrei Alexandrescu
9e15909243 Fix for issue 5152 2011-01-22 23:56:12 +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
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
SHOO
cdc546892d Retry Issue 5340
http://d.puremagic.com/issues/show_bug.cgi?id=5340

And added some unittest.

The changes of std.base64 are caused by char[] NOT being OutputRange.
is(R2 == char[]) && isOutputRange!(R2, char) always returns false.
2010-12-10 15:01:25 +00:00
SHOO
9d3ae0ad70 Revert.
Sorry, unittest was failure..

std\base64.d(404): Error: template std.base64.Base64Impl!('+','/').encode(R1,R2) if (isArray!(R1) && is(ElementType!(R1) : ubyte) && is(R2 == char[]) && isOutputRange!(R2,char)) does not match any function template declaration.
....

It seems to be necessary to check behavior of std.base64.
2010-12-10 11:44:55 +00:00
SHOO
28ed751472 Fixed: Issue 5340 - isOutputRange!(Appender!string, int) must be false
http://d.puremagic.com/issues/show_bug.cgi?id=5340
2010-12-10 11:24:36 +00:00
David Simcha
8331c70969 More 64 fixes for semantic errors that only show up when templates are instantiated via unittests. Now I'm actually serious about Phobos passing semantic analysis, except for a few modules due to weird druntime issues. 2010-11-10 05:25:50 +00:00
David Simcha
91bc314e2d Fix a few minor, unlisted bugs in InputRangeObject. 2010-11-08 03:07:54 +00:00
Lars T. Kyllingstad
53275d8851 5052: take!(Take!R) should return Take!R, not Take!(Take!R) 2010-10-14 07:15:19 +00:00
Shin Fujishiro
3ec3fee75a Ddoc: Fixed bug 4634 and some trivial doc isues in std.algorithm & range.
- Bug 4634: typo in levenshteinDistanceAndPath documentation
- Got rid of mentions of iterator-age begin(r)
- equal() not equals()
2010-10-13 05:40:03 +00:00
Shin Fujishiro
3c048ac456 Migration of tup.field[k] to tup[k].
Replaced ad-hoc 'is tuple?' checks with isTuple template.

The "this._cache" change in std.range is just a workaround for bug 5046.
2010-10-13 05:39:53 +00:00
David Simcha
1fd3b635c5 Bug 5035: Schrödinger's Stride 2010-10-13 00:18:02 +00:00
Andrei Alexandrescu
822a29cf89 unittest to avoid regression for bugzilla 3181 2010-09-27 01:22:14 +00:00
Andrei Alexandrescu
58b0b79703 Fix for bugzilla 2930 2010-09-26 22:28:31 +00:00
David Simcha
b597d23f83 Bug 4888: Heavy reliance on Bug 3534 in Phobos range usage. I used a different approach here than the first one I tried. I only did what was necessary to make Phobos work instead of trying to fix the deeper issue of making std.algorithm to work w/ const/immutable arrays. 2010-09-18 21:00:52 +00:00
David Simcha
ab60a7d7a1 Fix std.range.Zip. 2010-09-18 00:48:42 +00:00
David Simcha
5bc6e09d2b Mitigate const issues in std.range. Everything except Zip now at least works with const/immutable arrays of primitives. 2010-09-18 00:34:20 +00:00
David Simcha
a1c63984cc Fix debug code in SortedRange. 2010-09-17 04:06:56 +00:00
David Simcha
a0162ed834 Make SortedRange work with const/immutable arrays. 2010-09-17 00:32:28 +00:00
Andrei Alexandrescu
bf93b229c1 Replaced the random number generator with a cheaper one in SortedRange's constructor 2010-09-16 18:22:48 +00:00
Andrei Alexandrescu
627023c5d9 Fixed unlisted bug in SortedRange's constructor 2010-09-16 18:15:30 +00:00
David Simcha
72d6bf1217 Add back lowerBound, upperBound, canFindSorted, equalRange to std.algorithm, but with "scheduled for deprecaton" pragmas on instantiation. 2010-09-15 23:02:23 +00:00
David Simcha
f252d5e611 Support pointers to structs in std.range.put(). 2010-09-15 22:41:50 +00:00
Andrei Alexandrescu
a92a8a9c4e Fix for bugzilla 4861 2010-09-13 22:58:10 +00:00