Commit graph

319 commits

Author SHA1 Message Date
Brad Anderson
746afc47b8 Fix link to put primitive in std.range docs 2013-05-28 20:39:57 -06:00
David Nadlinger
dc4fe37080 Merge pull request #992 from monarchdodra/chunks
Update in chunks
2013-05-27 04:16:23 -07:00
monarch dodra
3e8a8cd887 fix typo in comment 2013-05-27 13:10:43 +02:00
jmdavis
ce1b2294b0 Undocument some deprecated functions.
They were marked for removal in the docs (many of them were intended to
be removed in January), so now they've been removed from the docs and
marked for removal from the code in November.
2013-05-05 16:34:25 -07:00
Vladimir Panteleev
16286c045b DDoc tweaks and fixes 2013-04-18 23:49:06 +00:00
monarch dodra
6f21319029 Update in chunks
reduces requirements to ForwardRange
2013-03-27 08:08:55 +01:00
unknown
dd1a80c56f Fixup for cycle RangeError invocation
From: #1183 :
Issue 9612: Cycle opSlice should throw when finish > start

Because a RangeError is not actually customizable, and the first argument is actually the file name. The error was producing:
```
core.exception.RangeError@2 > 1(3836): Range violation
```

Now it produces:
```
core.exception.RangeError@std\range.d(3835): Range violation
```
2013-03-10 22:16:12 +01:00
Brad Anderson
b7d075d555 Cycle opSlice should throw when finish > start
Issue 9612
2013-02-27 18:37:23 -07:00
jmdavis
2735d30f4e Remove all uses of std.metastrings.Format. 2013-02-24 18:42:46 -08:00
Andrej Mitrovic
c0713f1b79 Refactor lockstep and simplify opApply string mixin generator. 2013-02-08 22:57:39 +01:00
Andrei Alexandrescu
e57c8c7393 Merge pull request #1008 from monarchdodra/save
Consolidating forward range requirements
2013-02-04 21:03:08 -08:00
monarch dodra
54b151ffdb Consolidating forward range requirements
Because returning anything other than an *exact* type match messes everything up. This is particularly true in the sense that "saved" ranges are usually passed directly to a function, so not cast back to the original.
2013-02-04 18:55:14 +01:00
jmdavis
70dbc120bd Uncommented stuff that was commented out due to bug 9947.
Kenji missed a couple of lines of commented out code in hasSlicing, so
this commit uncomments them now that bug 9947 has been fixed.
2013-02-03 17:10:21 -08:00
Andrei Alexandrescu
a765c38c79 Merge pull request #1109 from 9rnsr/fix8847
Enable hasSlicing test which had been blocked by bug 9947
2013-02-03 16:57:16 -08:00
k-hara
6109cb6192 Enable hasSlicing test which had been blocked by bug 9947 2013-02-04 09:34:48 +09:00
Andrej Mitrovic
3625bcb7e8 Fixes Issue 8920 - iota should work with types smaller than int. 2013-02-04 01:14:13 +01:00
Daniel Murphy
41a9f1fa05 Fix Issue 6408 - Phobos fixes
Do not use typeof(Type[0]) to get the element type of an array, use typeof(Type.init[0])
2013-01-18 19:10:16 +11:00
jmdavis
9bab8393c3 Made cycle's DollarToken private.
There's no reason for anyone to use it directly, so it's better for it
to be private.
2013-01-12 22:51:35 -08:00
Alex Rønne Petersen
c1c7adec0c Merge pull request #1065 from monarchdodra/repeatSlice
Provide slicing for Repeat
2013-01-12 08:50:29 -08:00
Alex Rønne Petersen
fa6131bb29 Merge pull request #1069 from monarchdodra/zipLockstep
Const fixes in Zip and Lockstep
2013-01-11 02:46:52 -08:00
jmdavis
1ec00a35d8 Add opSlice to Cycle. 2013-01-11 00:05:16 -08:00
unknown
24164c5e9b Various fixes in lockstep and zip
Mainly, they accepted the types R, provided Unqual!R is a range. But that doesn't make sense.

Reduced to only accepting if R itself is a range.

Improved constraints, fixed implementations, removed needles bug workaround.
2013-01-11 08:31:09 +01:00
unknown
af67984222 Activate bugfix 6336 unittest 2013-01-11 08:31:08 +01:00
monarch dodra
8298d0dfc3 Provide slicing for Repeat 2013-01-10 23:47:47 +01:00
monarch dodra
4fdaafa8a9 Remove back/popBack primitives from Repeat
Because a bidirectional infinite range makes no sense. AFAIK.
2013-01-10 13:31:47 +01:00
monarch dodra
273e5821ad use enum opDollar in Sequence
Because an enum is better than a function
2013-01-10 13:29:03 +01:00
monarch dodra
47ab0b3f92 Fix zip for slicing infinite ranges
Because the type returned is not the same.
2013-01-10 13:27:47 +01:00
Andrei Alexandrescu
ca44a116d5 Merge pull request #1047 from Poita/bug8367
Issue 8367 - Insufficient constraints for chain
2013-01-08 23:07:23 -08:00
Nick Treleaven
5083260795 Fix typos 2013-01-07 17:01:11 +00:00
Vladimir Panteleev
600862c927 Fix mismatched parens in DDoc. 2013-01-06 23:32:52 +02:00
Poita
3731c856c7 Undoing formatting error 2013-01-03 08:52:34 +00:00
Poita
8977fd6ae3 Changed only.Result to static struct 2013-01-03 08:45:46 +00:00
Peter Alexander
fb3a15a33f Voldemortification of std.range.only 2013-01-03 07:54:40 +00:00
Peter Alexander
483efc7d09 New docs, examples, added asserts for Only!T 2013-01-02 23:11:58 +00:00
Peter Alexander
7101a9c248 Using version(D_NoBoundsCheck) for Only!T 2013-01-02 05:20:38 +00:00
Peter Alexander
51c4f07756 Use RangeError + length optimisation for Only!T 2013-01-02 04:57:04 +00:00
Peter Alexander
1008da752b Issue 8367 - Insufficient constraints for chain
The error message from compiling the bug's sample code after this change is:

```
bug.d(11): Error: template std.range.chain does not match any function template declaration. Candidates are:
std/range.d(2018):        std.range.chain(Ranges...)(Ranges rs) if (Ranges.length > 0 && allSatisfy!(isInputRange, staticMap!(Unqual, Ranges)) && !is(CommonType!(staticMap!(ElementType, staticMap!(Unqual, Ranges))) == void))
bug.d(11): Error: template std.range.chain(Ranges...)(Ranges rs) if (Ranges.length > 0 && allSatisfy!(isInputRange, staticMap!(Unqual, Ranges)) && !is(CommonType!(staticMap!(ElementType, staticMap!(Unqual, Ranges))) == void)) cannot deduce template function from argument types !()(MapResult!(__lambda2, Foo[]),string)
```

Fixes Issue 8367
http://d.puremagic.com/issues/show_bug.cgi?id=8367
2013-01-01 21:17:06 +00:00
Peter Alexander
c8cf9197e6 Added std.range.only - range of a single element.
This adds range type `Only!T` and helper function `only!T(T)`. This is a range that iterates a single value, useful when some interface requires a range, but you only have a single value.
2013-01-01 20:51:19 +00:00
k-hara
2bbb33df2f Additional fix for issue 6905
For the inference of return value ref-ness, we should use 'auto ref' instead of 'ref' or 'const ref'
2012-12-24 17:48:17 +09:00
unknown
1c58c2d23c Gives sequence slice to end 2012-12-18 08:11:17 +01:00
Andrei Alexandrescu
af12683895 Merge pull request #854 from jmdavis/hasSlicing
Improvements to hasSlicing
2012-12-17 21:38:26 -08:00
k-hara
46b612de08 fix Issue 9060 - std.range.chain and std.range.zip cannot get frame pointer
Changes to avoid following two errors:
* "cannot access frame pointer"
* "field xxx must be initialized in constructor, because it is nested struct"
2012-12-18 09:22:24 +09:00
jmdavis
68db081f1e Removed incorrect @property attributes in std.range.
They were removed previously but reintroduced due to a bad rebase, so
I'm removing them again here.
2012-12-16 22:29:42 -08:00
jmdavis
a916ad8afb Strengthened isRandomAccess with regards to $.
It now requires that indexing with $ result in the same type as front if
r[$] works, and if that works, and the range isn't infinite, r[$ - 1]
must be the same type as front. Ideally, we'd require that r[$] work
regardless, but without enhancement #7177 being implemented, that would
likely break too much code, as opDollar was only recently fixed and
probably isn't used much.
2012-12-16 22:28:18 -08:00
jmdavis
6022082b29 Further strengthen hasSlicing.
The extra requirements are not currently enabled because of bug# 8847,
but they're now there, and they're listed as their in the documentation
so that no one will think that they're not supposed to apply.
2012-12-16 22:28:18 -08:00
jmdavis
a0b82a53b8 Add some requirements for opDollar to hasSlicing.
Ideally, opDollar would be outright required for any range with slicing,
but unless/until it's changed so that length automatically aliases to
opDollar when opDollar isn't defined (issue# 7177), that's probably not
a reasonable requirement to make.
2012-12-16 22:28:17 -08:00
jmdavis
0d9b31b594 Adustments to hasSlicing.
Now, it enforces that opSlice returns a range which can be assigned to
the original range type (so that it can be assigned to the original
range as long as the original range isn't const) as long as it's finite,
and it enforces that opSlice's result is the result of take when the
range is infinite.
2012-12-16 22:28:17 -08:00
jmdavis
24a696a2b2 Adjustments to take and takeExactly.
takeExactly now returns the same type as take where possible, and
neither take nor takeExactly check hasSlicing for infinite ranges (since
infinite ranges will soon be required to use them for slicing, and that
creates a circular dependency among those 3 templates
2012-12-16 22:28:16 -08:00
jmdavis
f8f2a81a60 Revert "Fix std.range.takeExactly trait to reject slices without length."
This reverts commit 6a0b6c4dee.
2012-12-16 22:28:15 -08:00
Andrei Alexandrescu
259cd23d67 Merge pull request #901 from Poita/bug8900
Fix bug 8900 - Zip with infinite char range fails.
2012-12-13 09:00:09 -08:00