Commit graph

197 commits

Author SHA1 Message Date
David Simcha
687ae12600 Bug 4387: std.range.Cycle assumes lvalue elements. 2010-08-13 02:39:07 +00:00
SHOO
06f0bbd521 unittest and changelog for r1809 2010-08-06 08:45:09 +00:00
SHOO
ce5e6d2562 Bugzilla 4570: ElementType!(void[]) shows error message.
Fixed.
2010-08-05 14:16:28 +00:00
Andrei Alexandrescu
51690bb826 Improved retro 2010-07-28 08:03:04 +00:00
Andrei Alexandrescu
39739033b2 put(R, E) definition and fix for bugzilla 4456 2010-07-14 01:16:18 +00:00
Andrei Alexandrescu
a98c020493 Changed definition of isOutputRange and introduced universal function put(R, E) that puts an element in an output range. 2010-07-12 00:50:32 +00:00
Andrei Alexandrescu
723a603369 Changed definition of isOutputRange and also added the free function put that effects outputting stuff to such a range. 2010-07-09 04:18:41 +00:00
Andrei Alexandrescu
432e3fdfc8 Replaced std.contracts with std.exception throughout 2010-07-04 22:09:03 +00:00
Andrei Alexandrescu
11cc1f0f9b License format change 2010-07-04 21:45:22 +00:00
David Simcha
09962831b2 More higher order range testing improvements. 2010-07-03 21:42:27 +00:00
David Simcha
93032c1da8 @property cleanup for std.range. 2010-07-01 02:51:24 +00:00
David Simcha
619beee74d Improve unittests for higher order ranges in std.algorithm, fix some unlisted bugs. 2010-06-30 02:30:26 +00:00
David Simcha
f92cbf1534 More unittest improvements for std.range. Most of them are commented out b/c they don't work yet, but fixing them sanely is blocked by DMD bug 3294. 2010-06-29 02:58:31 +00:00
David Simcha
d179c32f17 More unittest improvements and wholesale fixing/cleanup for std.range. 2010-06-25 03:06:54 +00:00
David Simcha
be680b9b08 Start improving std.range unittests. Lots of bugs found already. 2010-06-24 00:38:40 +00:00
Andrei Alexandrescu
59a55d66fd Fixed bugzilla 3839 2010-06-23 15:50:01 +00:00
David Simcha
d6cefbcf7e Fix unittests in std.range. 2010-06-23 13:07:31 +00:00
Lars T. Kyllingstad
80974fc70e Fixed unlisted bug: std.range.cycle() doesn't work with infinite ranges.
It was attempted to use the eponymous template trick inside a templated struct, like this:

  struct Cycle(R)
  {
      static if (isInfinite!R) alias R Cycle;
      ...
  }

but of course that doesn't work.  I've written the isInfinite case as a separate template instead, and added a unittest for it.
2010-06-23 08:53:42 +00:00
Andrei Alexandrescu
94855ad96c Improved iota 2010-06-22 22:45:26 +00:00
David Simcha
11de4c570c Bug 4362: std.range.repeat and cycle do not have a .save() method 2010-06-22 12:31:44 +00:00
David Simcha
69fddbe212 Bug 3439: std.range.Sequence.opIndex not consistent after calling popFront(). 2010-06-18 01:47:10 +00:00
David Simcha
bb1a55b4a6 Added save() for std.range.repeat. 2010-06-13 15:48:00 +00:00
Andrei Alexandrescu
a540277ede Removed the BinaryHeap range 2010-06-10 15:57:35 +00:00
Andrei Alexandrescu
69e5a68a7e Added the existence of the property save as a condition for isForwardRange; added save to the range defined within; replaced a couple of awkward front() implementations; defined module-level moveFront() and range member moveFront() where appropriate; added @property maxLength to Take; arranged things such that take() for slice-able ranges returns the same type as the slice; eliminated SListRange; defined iota() with one argument; moved BinaryHeap within. 2010-06-08 17:32:35 +00:00
Shin Fujishiro
f110187637 Removed backByBack code from r1566. It was too slow for large input ranges.
Fixed typo.
2010-05-29 14:18:18 +00:00
Shin Fujishiro
b41e1655bf Fixed bugzilla 3876: std.range.Take back/popBack methods don't work correctly.
Thanks to Philippe Sigaud for the proposed solution.  It was helpful.

The former implementation simply used input.back for Take.back.  It didn't work if input.length was larger than maxAvailable.  For example:
  input = [ 1, 2, 3, 4, 5 ]
  s = take(input, 3)            // [ 1, 2, 3 ]
  s.back == input.back == 5     // wrong!

Take must pop all the excess elements from the input ([4,5] in the above example) to provide correct back element.  This change makes it to do so if input is purely bidirectional.  (random access is used instead if possible.)

- Added Take.opSlice
- Added some enforcement error messages
2010-05-29 13:43:59 +00:00
Masahiro Nakagawa
22ccee5459 Delete const from std.range.Repeat methods 2010-05-22 20:21:37 +00:00
Shin Fujishiro
5c9725d6cd Moved allSatisfy and staticMap to std.typetuple 2010-05-18 11:15:44 +00:00
Masahiro Nakagawa
5cbe2adf7a bugzilla 3873 std.range.repeat should have popBack defined 2010-05-17 16:34:10 +00:00
Masahiro Nakagawa
a288172908 Add @property to length method. 2010-05-04 21:54:00 +00:00
Andrei Alexandrescu
2a9a6e336c string, wstring are now bidirectional (not random) ranges
std.algorithm: defined move with one argument; levenshtein distance generalized to with all forward ranges; take now has swapped arguments
std.array: empty for arrays is now a @property; front and back for a string and wstring automatically decodes the first/last character; popFront, popBack for string and wstring obey the UTF stride
std.conv: changed the default array formatting from "[a, b, c]" to "a b c"
std.range: swapped order of arguments in take
std.stdio: added readln template
std.variant: now works with statically-sized arrays and const data
std.traits: added isNarrowString
2010-02-22 15:52:31 +00:00
David Simcha
e54374a02d bugzilla 3311: std.range.chain shouldn't have opIndexAssign if arguments aren't mutable. 2009-12-01 14:17:11 +00:00
Andrei Alexandrescu
45508f1497 Reinstated some unittests; fixed Cycle to work with the new fixed-size arrays; fixed bug in Transposed 2009-10-27 00:09:51 +00:00
Sean Kelly
747f3cf1e4 Changed Phobos to use the Boost license. Currently, all public domain modules and all licensed modules by Walter, Andrei, Bartosz, and Don have been changed to use this license (excepting std.c, for the moment). Ideally, all Phobos modules will eventually be distributed under this license, which means obtaining permission from a few more authors, deleting, or rewriting some modules.
Removed std.openrj.
2009-09-16 18:19:51 +00:00
Andrei Alexandrescu
c74aeaee57 Bug 3310 fix 2009-09-11 17:08:32 +00:00
Andrei Alexandrescu
13d5edc728 Changed attribution per attributor's request 2009-09-05 20:22:03 +00:00
Andrei Alexandrescu
0c142994d9 See changelog - bunch of bug fixes and a couple additions for release 2.032 2009-08-31 19:46:33 +00:00
Andrei Alexandrescu
ab1f501146 defined Take.popBack whenever sensible; improved iota to accept negative ranges and steps; fixed BUGZILLA 3000: iota should work with floats 2009-07-11 19:07:16 +00:00
Andrei Alexandrescu
b151c9f96b bugzilla 3000 - iota should work with floats 2009-07-07 17:01:19 +00:00
Andrei Alexandrescu
3cb5869e25 Fixed unlisted bug in std.range.retro: retro'izing a range twice must return the original range 2009-07-04 07:05:39 +00:00
Andrei Alexandrescu
3f480aaa93 minor 2009-05-01 01:00:11 +00:00
Andrei Alexandrescu
e486c557bc Added iota with two arguments. Added FrontTransversal and Transversal. 2009-04-29 22:08:52 +00:00
Don Clugston
c602c4506f I've commented out two broken unit tests. They now print a pragma(msg), so they won't be forgotten. With these changes, tests now pass on Windows. 2009-04-22 09:17:21 +00:00
Andrei Alexandrescu
5ba3fd53bd Updated documentation and unittest for cons() in wake of fixing bug 2676 2009-04-21 12:36:06 +00:00
Andrei Alexandrescu
dfef2a7214 Replaced next, retreat, head, and toe with (respectively) popFront, popBack, front, and back 2009-04-13 19:10:58 +00:00
Andrei Alexandrescu
ec9054c283 naming and doc fixes prompted by Lars Kyllingstad 2009-04-11 20:40:43 +00:00
Andrei Alexandrescu
49f646271b Range operations. 2009-04-06 20:48:41 +00:00