Commit graph

3847 commits

Author SHA1 Message Date
Walter Bright
ef0bed7d15 fix memory corruption bug in unittest 2012-12-24 20:16:19 -08:00
Jonathan M Davis
aedc7ee588 Merge pull request #1023 from monarchdodra/extend
Minor tweaks in std.string
2012-12-21 08:31:40 -08:00
monarch dodra
cd9bc7e7e8 missing import 2012-12-21 12:07:23 +01:00
monarch dodra
78873a582d representation unittest 2012-12-21 11:31:09 +01:00
monarch dodra
83200a11f3 FormatError => FormatException
Because it's deprecated.
2012-12-21 11:27:22 +01:00
Andrei Alexandrescu
d9170a8c74 Merge pull request #1001 from 9rnsr/fix8908
Issue 8908 - Collapse of std.csv by the specifications change of std.conv.parse
2012-12-18 15:02:57 -08:00
Andrei Alexandrescu
af12683895 Merge pull request #854 from jmdavis/hasSlicing
Improvements to hasSlicing
2012-12-17 21:38:26 -08:00
Andrei Alexandrescu
3a0f062bc2 Merge pull request #1016 from chadjoan/patch-3
Doc fix: an O(1) op was documented as O(log(n))
2012-12-17 21:11:42 -08:00
Walter Bright
3b683d99bf Merge pull request #1004 from 9rnsr/fix9060
Issue 9060 - std.range.chain and std.range.zip cannot get frame pointer
2012-12-17 21:02:38 -08:00
cjoan
32494e8da3 Doc fix: an O(1) op was documented as O(log(n))
I thought it was odd that inserting an element at the front of a singly-linked-list would be an O(log(n)) operation.  Too expensive!  So I looked at the code and it does seem to be O(1).  I'm hoping this is just needing a documentation edit ;)
2012-12-17 20:58:51 -05:00
Alex Rønne Petersen
cc3176ab76 Merge pull request #1015 from monarchdodra/spaces
Removing trailing spaces in algorithm
2012-12-17 17:05:46 -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
k-hara
b66012ef4e fix Issue 8908 - Collapse of std.csv by the specifications change of std.conv.parse 2012-12-18 09:11:57 +09:00
unknown
027804bc28 Removing trailing spaces 2012-12-17 18:54:47 +01: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
57ddea7cf2 Fix to Map caused by changes to hasSlicing.
import std.algorithm;
import std.range;

void main()
{
    auto N2 = sequence!"n"(cast(size_t)1).map!"a";
}

ceased to compile, because Map's opSlice won't work anymore over
infinite ranges, because the result can't be reassigned to the original.
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
7d5d9fb1c0 Some whitespace cleanup. 2012-12-16 22:28:16 -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
H. S. Teoh
3a2377ccd3 Replace joiner unittest with one that doesn't suffer from issue 9131. 2012-12-16 21:35:22 -08:00
H. S. Teoh
e471f8ee13 Completely get rid of UTF-8 to workaround OSX/64 bug. 2012-12-16 21:35:22 -08:00
H. S. Teoh
f83ad8a572 Add unittest for new joiner. 2012-12-16 21:35:22 -08:00
H. S. Teoh
d489281292 Rewrite joiner to not assume persistence of .front. 2012-12-16 21:35:22 -08:00
Hara Kenji
194ca07803 Merge pull request #1011 from blackwhale/fix-multisort
fix issue 9160 multiSort constraint regression
2012-12-16 17:34:09 -08:00
Peter Alexander
b7472c4e39 Corrected constraints for std.algorithm.endsWith
Previously endsWith constraints only required input ranges, but the algorithm uses `back` and `popBack` within, so clearly a bidirectional range is needed.
2012-12-15 23:20:20 +00:00
Dmitry Olshansky
bde7cbad4d fix issue 9160 multiSort constraint bug 2012-12-15 18:07:57 +04:00
Lars T. Kyllingstad
b6b223ecdb Merge pull request #1005 from MaksimZh/real-to-complex
Simplified initialization of complex numbers
2012-12-14 03:37:18 -08:00
Andrei Alexandrescu
1b2b5fb76e Merge pull request #951 from monarchdodra/count3
improvements/fixes for count countUntil
2012-12-13 09:17:47 -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
Andrei Alexandrescu
7086e08d2a Merge pull request #918 from jerro/upstream-master
Fixed a bug in gammaIncompleteCompl
2012-12-13 08:58:30 -08:00
Dmitry Olshansky
9e35a4d8ee address review remarks 2012-12-13 20:48:24 +04:00
Dmitry Olshansky
222c803536 re-style and fix indention 2012-12-13 20:41:21 +04:00
Dmitry Olshansky
b7286e7444 generalize countLength 2012-12-13 20:41:20 +04:00
Dmitry Olshansky
96a22304d8 another -property error 2012-12-13 20:41:20 +04:00
Dmitry Olshansky
016a55a561 structs with postblit, CTFE, fix -property 2012-12-13 20:41:19 +04:00
Dmitry Olshansky
14e457b37d fix issue 4489 std.array.insert is slow 2012-12-13 20:41:19 +04:00
Maksim Zholudev
494e6bd35e Improved unittest 2012-12-13 14:20:48 +01:00
k-hara
1c54f33603 fixup for Issue 8902
After default initialization, only the first one in overlapped fields is readable in CTFE.
2012-12-13 19:29:33 +09:00
Maksim Zholudev
b5ff933a19 Added unittest 2012-12-13 10:44:32 +01:00
Andrei Alexandrescu
f12c860a23 Merge pull request #896 from denis-sh/std.conv.emplace-fixes
`std.conv.emplace` fixes & improvements
2012-12-12 07:41:03 -08:00
Andrei Alexandrescu
0fcca44b8d Merge pull request #787 from blackwhale/loan-stable-sort
fix stable sort (4584)
2012-12-12 07:38:10 -08:00
Maksim Zholudev
7a7aeb7eb3 Added initialization of e.g. Complex!double with Complex!real 2012-12-12 14:48:17 +01:00
Maksim Zholudev
14d3359396 Fixed for the case of different types of real and imaginary parts. 2012-12-12 14:40:32 +01:00
Maksim Zholudev
1970cb6cc6 Added possibility to initialize complex numbers with "real" types 2012-12-12 14:29:50 +01:00
Jonathan M Davis
85887b9b3c Merge pull request #1002 from donc/fastcompile_typecons
10% faster compile for std.algorithm
2012-12-11 02:15:50 -08:00
Don Clugston
5ef89e6c86 10% faster compile for std.algorithm
by fixing incredibly slow Tuple code.
2012-12-11 08:31:20 +01:00