Commit graph

328 commits

Author SHA1 Message Date
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
jmdavis
74f8c844fe Revert "Add alias opDollar and use $ in range slicing"
This reverts commit 07104b5fe6.

As we cannot currenly rely on even ranges with slicing implementing
opDollar, this change breaks code, because it assumes that such ranges
implement opDollar.
2012-12-09 17:21:37 -08:00
Andrei Alexandrescu
7701b17fa7 Merge pull request #985 from jmdavis/range
Remove comments from range traits claiming that they don't require ranges
2012-12-08 20:51:15 -08:00
k-hara
07104b5fe6 Add alias opDollar and use $ in range slicing 2012-12-05 10:13:17 +09:00
k-hara
7ced8ac866 popFront and popBack are not properties 2012-12-03 00:53:54 +09:00
k-hara
2520cd0dc9 Should not mark member functions for operator overloading as properties. 2012-12-03 00:53:53 +09:00
k-hara
58a8ccf42e Fix for moveFront, moveBack, and moveAt
- I assume they are not properties, then changed to normal functions.
- Global .moveFront/Back uses front and back if member moveFront/back doesn't exist.
  Then, member aliases are just redundant.
2012-12-03 00:53:52 +09:00
jmdavis
be3e9d1bb3 Remove comments from range traits claiming that they don't require ranges.
I don't know why these were added or how they got past the reviewers,
but it makes no sense for traits which check ranges for various
attributes to say that they don't require a range - especially when they
specifically check stuff like front! The only two where such a comment
makes sense (hasLength and ElementType) already had such comments,
making the comments added to them redundant, whereas the others were
just plain wrong. This commit removes all of those incorrect comments.
2012-11-30 20:45:18 -08:00
unknown
783abf3fa6 Add popExactly/dropExactly/dropOne
Also:
* Consolidate the pairs "drop/dropBack" and "popFrontN/popBackN" into a single documented block
* Remove "dropFront" (useless alias)
2012-11-29 09:19:58 +01:00
Alex Rønne Petersen
1c22141596 Merge pull request #967 from 9rnsr/enforceProperty
For the more property enforcement
2012-11-22 22:29:20 -08:00
k-hara
01df2f60be Remove redundant parenthesis for getters, and use assignment syntax for setters 2012-11-23 15:07:17 +09:00
k-hara
2897ca8807 fix Issue 9062 - AddrExp should distinguish the existence of property resolution 2012-11-23 14:25:24 +09:00
Andrei Alexandrescu
5de964dea9 Merge pull request #941 from denis-sh/refactor-std.range.put
Refactor `std.range.put`
2012-11-18 20:56:53 -08:00
jmdavis
90e9bfee9d Quick fix to some ddoc comments so that they compile. 2012-11-16 22:24:06 -08:00
unknown
5f33a589e7 Insert dropBack, more examples of drop
Also fixes popBackN to only work on bidir.
Adds a logical path for popFrontN with infinite sliceable ranges.
2012-11-15 19:30:01 +01:00
Alex Rønne Petersen
5ed20fced6 Merge pull request #940 from denis-sh/reformat-std.range-book-table
Reformat `std.range` book table
2012-11-14 11:18:56 -08:00
Alex Rønne Petersen
c9c65fed95 Merge pull request #944 from denis-sh/fix-std.range-documentation
Fix `std.range` documentation
2012-11-14 11:17:26 -08:00
Denis Shelomovskij
6a0b6c4dee Fix std.range.takeExactly trait to reject slices without length. 2012-11-14 23:11:00 +04:00
Denis Shelomovskij
16d4fa385f Fix std.range.Chunks trait to reject not input ranges. 2012-11-14 23:11:00 +04:00
Denis Shelomovskij
0d5daf7f7f Add note for all std.range public members intentionally accepting non-ranges.
* intentionally means "not because of bugs"
2012-11-14 23:11:00 +04:00
Denis Shelomovskij
9cf17a4c47 Fix std.range.{hasAssignableElements,hasAssignableElements} documentation. 2012-11-14 23:10:45 +04:00
Denis Shelomovskij
f2393e58d9 Fix std.range.ElementType documentation. 2012-11-14 23:10:45 +04:00
Alex Rønne Petersen
236fd71b13 Merge pull request #942 from denis-sh/fix-std.range-templates-for-inout
Fix `std.range` templates for `inout`
2012-11-14 07:25:34 -08:00
Denis Shelomovskij
3b84e18bc8 Reformat std.range.put book table
Empty lines aren't allowed in `BOOKTABLE` macro as it results in inserting a "break" into a table.
2012-11-14 18:35:42 +04:00
Denis Shelomovskij
4abe76af39 Stay before 80 characters in reformatted std.range book table
Reformatted by @monarchdodra.
2012-11-14 18:35:01 +04:00
Denis Shelomovskij
51d48abb01 Add inout support to std.range.{hasMobileElements,lengthType} 2012-11-14 17:44:18 +04:00
Denis Shelomovskij
db1d909d7a Remove redundant dummy arguments for inout support names. 2012-11-14 15:28:50 +04:00
Denis Shelomovskij
222a938adf Fix std.range.isRandomAccessRange: is(typeof(r[1]) == typeof(r.front)) is also required. 2012-11-14 15:17:05 +04:00
Denis Shelomovskij
f767461a2d Refactor std.range.put: flatter static ifs. 2012-11-14 15:05:44 +04:00
Denis Shelomovskij
d6d438b024 Refactor std.range.put: use simpler (E[]).init instead of (&e)[0..1] hack in static ifs. 2012-11-14 14:36:30 +04:00
Denis Shelomovskij
6c3422a8aa Remove redundant checks from std.range.put static ifs 2012-11-14 14:29:26 +04:00
Denis Shelomovskij
a5ac871490 Reformat std.range book table
Empty lines aren't allowed in `BOOKTABLE` macro as it results in inserting a "break" into a table.
2012-11-14 13:03:24 +04:00
Peter Alexander
a00c3c825c Fix bug 8900 - Zip with infinite range fails.
`std.range.Zip` contains a `Tuple`, whose `toString()` function calls `formatElement` which eventually calls this function, leading to a static call to `walkLength` on infinite ranges. Since pul request 880, `walkLength` doesn't work with infinite ranges, so it fails to compile.

This change ensures that `walkLength` is called with only valid range types.

Bug: http://d.puremagic.com/issues/show_bug.cgi?id=8900
2012-10-27 12:02:56 +01:00
Alex Rønne Petersen
a4856a70cc Merge pull request #880 from monarchdodra/walkLength
Update walkLength impl; better support for inf.
2012-10-19 02:29:19 -07:00
monarch dodra
eb7b01eaba Update std/range.d 2012-10-19 09:27:02 +03:00
monarch dodra
6efa0268f4 Update walkLength doc and impl; support for inf. 2012-10-19 07:33:19 +02:00
jmdavis
3d92608c47 Added more deprecation messages. 2012-10-15 21:40:36 -07:00
monarch dodra
df798d4356 save consolidation 2012-10-14 12:19:10 +02:00
Brad Roberts
c07bce765c Merge pull request #821 from AndrejMitrovic/patch-2
Fix Issue 8676
2012-10-04 10:43:38 -07:00
Andrei Alexandrescu
04acd3f07e Merge pull request #829 from monarchdodra/popN
Tweak in /pop(Front|Back)N/
2012-10-03 21:23:42 -07:00
monarch dodra
2c7747ce56 Tweak in /pop(Front|Back)/ 2012-10-03 08:18:31 +02:00
monarch dodra
1ed21ed00b Tighter type checking for SortedRange 2012-10-02 19:51:33 +03:00