[Issue 6447] iota(BigInt) too
https://issues.dlang.org/show_bug.cgi?id=6447 Iain Buclaw changed: What|Removed |Added Priority|P2 |P4 --
[Issue 6447] iota(BigInt) too
https://issues.dlang.org/show_bug.cgi?id=6447 Russel Winder changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|WORKSFORME |--- --- Comment #17 from Russel Winder --- Using LDC on Debian Sid, the code: import std.bigint: BigInt; import std.range: iota; void main() { auto x = iota(BigInt(10)); } compiles and executes fine, but the code: void main() { import std.bigint: BigInt; import std.range: iota; iota(BigInt(1), BigInt(100), BigInt(5)); iota(BigInt(1), BigInt(100), 5); } results in: test_b.d(4): Error: template std.range.iota cannot deduce function from argument types !()(BigInt, BigInt, BigInt), candidates are: /usr/lib/ldc/x86_64-linux-gnu/include/d/std/range/package.d(5371): std.range.iota(B, E, S)(B begin, E end, S step) if ((isIntegral!(CommonType!(B, E)) || isPointer!(CommonType!(B, E))) && isIntegral!S) /usr/lib/ldc/x86_64-linux-gnu/include/d/std/range/package.d(5481): std.range.iota(B, E)(B begin, E end) if (isFloatingPoint!(CommonType!(B, E))) /usr/lib/ldc/x86_64-linux-gnu/include/d/std/range/package.d(5488): std.range.iota(B, E)(B begin, E end) if (isIntegral!(CommonType!(B, E)) || isPointer!(CommonType!(B, E))) /usr/lib/ldc/x86_64-linux-gnu/include/d/std/range/package.d(5558): std.range.iota(E)(E end) if (is(typeof(iota(E(0), end /usr/lib/ldc/x86_64-linux-gnu/include/d/std/range/package.d(5567): std.range.iota(B, E, S)(B begin, E end, S step) if (isFloatingPoint!(CommonType!(B, E, S))) test_b.d(4):... (1 more, -v to show) ... test_b.d(5): Error: template std.range.iota cannot deduce function from argument types !()(BigInt, BigInt, int), candidates are: /usr/lib/ldc/x86_64-linux-gnu/include/d/std/range/package.d(5371): std.range.iota(B, E, S)(B begin, E end, S step) if ((isIntegral!(CommonType!(B, E)) || isPointer!(CommonType!(B, E))) && isIntegral!S) /usr/lib/ldc/x86_64-linux-gnu/include/d/std/range/package.d(5481): std.range.iota(B, E)(B begin, E end) if (isFloatingPoint!(CommonType!(B, E))) /usr/lib/ldc/x86_64-linux-gnu/include/d/std/range/package.d(5488): std.range.iota(B, E)(B begin, E end) if (isIntegral!(CommonType!(B, E)) || isPointer!(CommonType!(B, E))) /usr/lib/ldc/x86_64-linux-gnu/include/d/std/range/package.d(5558): std.range.iota(E)(E end) if (is(typeof(iota(E(0), end /usr/lib/ldc/x86_64-linux-gnu/include/d/std/range/package.d(5567): std.range.iota(B, E, S)(B begin, E end, S step) if (isFloatingPoint!(CommonType!(B, E, S))) test_b.d(5):... (1 more, -v to show) ... Using dmd from d-apt the first code works fine and the second code results in: test_b.d(4): Error: template `std.range.iota` cannot deduce function from argument types `!()(BigInt, BigInt, BigInt)`, candidates are: /usr/include/dmd/phobos/std/range/package.d(5890):`std.range.iota(B, E, S)(B begin, E end, S step) if ((isIntegral!(CommonType!(B, E)) || isPointer!(CommonType!(B, E))) && isIntegral!S)` /usr/include/dmd/phobos/std/range/package.d(6000):`std.range.iota(B, E)(B begin, E end) if (isFloatingPoint!(CommonType!(B, E)))` /usr/include/dmd/phobos/std/range/package.d(6007):`std.range.iota(B, E)(B begin, E end) if (isIntegral!(CommonType!(B, E)) || isPointer!(CommonType!(B, E)))` /usr/include/dmd/phobos/std/range/package.d(6077):`std.range.iota(E)(E end) if (is(typeof(iota(E(0), end` /usr/include/dmd/phobos/std/range/package.d(6086):`std.range.iota(B, E, S)(B begin, E end, S step) if (isFloatingPoint!(CommonType!(B, E, S)))` test_b.d(4):... (1 more, -v to show) ... test_b.d(5): Error: template `std.range.iota` cannot deduce function from argument types `!()(BigInt, BigInt, int)`, candidates are: /usr/include/dmd/phobos/std/range/package.d(5890):`std.range.iota(B, E, S)(B begin, E end, S step) if ((isIntegral!(CommonType!(B, E)) || isPointer!(CommonType!(B, E))) && isIntegral!S)` /usr/include/dmd/phobos/std/range/package.d(6000):`std.range.iota(B, E)(B begin, E end) if (isFloatingPoint!(CommonType!(B, E)))` /usr/include/dmd/phobos/std/range/package.d(6007):`std.range.iota(B, E)(B begin, E end) if (isIntegral!(CommonType!(B, E)) || isPointer!(CommonType!(B, E)))` /usr/include/dmd/phobos/std/range/package.d(6077):`std.range.iota(E)(E end) if (is(typeof(iota(E(0), end` /usr/include/dmd/phobos/std/range/package.d(6086):`std.range.iota(B, E, S)(B begin, E end, S step) if (isFloatingPoint!(CommonType!(B, E, S)))` test_b.d(5):... (1 more, -v to show) ... So I think this problem is not fixed. --
[Issue 6447] iota(BigInt) too
https://issues.dlang.org/show_bug.cgi?id=6447 Dmitry Olshansky changed: What|Removed |Added Status|NEW |RESOLVED CC||dmitry.o...@gmail.com Resolution|--- |WORKSFORME --- Comment #16 from Dmitry Olshansky --- Works now. --
[Issue 6447] iota(BigInt) too
https://issues.dlang.org/show_bug.cgi?id=6447 --- Comment #15 from github-bugzi...@puremagic.com --- Commit pushed to 2.067 at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/b159a5bdc980abb90833b32fa04044a002dfc794 Merge pull request #2895 from quickfur/iota_bigint --
[Issue 6447] iota(BigInt) too
https://issues.dlang.org/show_bug.cgi?id=6447 --- Comment #13 from bearophile_h...@eml.cc --- I keep this issue open because this still doesn't work: void main() { import std.bigint: BigInt; import std.range: iota; iota(BigInt(1), BigInt(100), BigInt(5)); iota(BigInt(1), BigInt(100), 5); } test.d(4,9): Error: template std.range.iota cannot deduce function from argument types !()(BigInt, BigInt, BigInt), candidates are: ...\dmd2\src\phobos\std\range\package.d(4008,6):std.range.iota(B, E, S)(B begin, E end, S step) if ((isIntegral!(CommonType!(B, E)) || isPointer!(CommonType!(B, E))) isIntegral!S) ...\dmd2\src\phobos\std\range\package.d(4098,6):std.range.iota(B, E)(B begin, E end) if (isFloatingPoint!(CommonType!(B, E))) ...\dmd2\src\phobos\std\range\package.d(4105,6):std.range.iota(B, E)(B begin, E end) if (isIntegral!(CommonType!(B, E)) || isPointer!(CommonType!(B, E))) ...\dmd2\src\phobos\std\range\package.d(4168,6):std.range.iota(E)(E end) ...\dmd2\src\phobos\std\range\package.d(4176,6):std.range.iota(B, E, S)(B begin, E end, S step) if (isFloatingPoint!(CommonType!(B, E, S))) test.d(4,9):... (1 more, -v to show) ... test.d(5,9): Error: template std.range.iota cannot deduce function from argument types !()(BigInt, BigInt, int), candidates are: ...\dmd2\src\phobos\std\range\package.d(4008,6):std.range.iota(B, E, S)(B begin, E end, S step) if ((isIntegral!(CommonType!(B, E)) || isPointer!(CommonType!(B, E))) isIntegral!S) ...\dmd2\src\phobos\std\range\package.d(4098,6):std.range.iota(B, E)(B begin, E end) if (isFloatingPoint!(CommonType!(B, E))) ...\dmd2\src\phobos\std\range\package.d(4105,6):std.range.iota(B, E)(B begin, E end) if (isIntegral!(CommonType!(B, E)) || isPointer!(CommonType!(B, E))) ...\dmd2\src\phobos\std\range\package.d(4168,6):std.range.iota(E)(E end) ...\dmd2\src\phobos\std\range\package.d(4176,6):std.range.iota(B, E, S)(B begin, E end, S step) if (isFloatingPoint!(CommonType!(B, E, S))) test.d(5,9):... (1 more, -v to show) ... --
[Issue 6447] iota(BigInt) too
https://issues.dlang.org/show_bug.cgi?id=6447 --- Comment #14 from hst...@quickfur.ath.cx --- One thing at a time! The last PR implemented the iota(start,end) case. The next step is to extend it to handle the iota(start,end,step) case when += is supported. --
[Issue 6447] iota(BigInt) too
https://issues.dlang.org/show_bug.cgi?id=6447 --- Comment #12 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/b159a5bdc980abb90833b32fa04044a002dfc794 Merge pull request #2895 from quickfur/iota_bigint Issue 6447 10762: support user-defined types in iota() --
[Issue 6447] iota(BigInt) too
https://issues.dlang.org/show_bug.cgi?id=6447 hst...@quickfur.ath.cx changed: What|Removed |Added Keywords||pull --- Comment #11 from hst...@quickfur.ath.cx --- https://github.com/D-Programming-Language/phobos/pull/2895 --
[Issue 6447] iota(BigInt) too
https://issues.dlang.org/show_bug.cgi?id=6447 --- Comment #10 from hst...@quickfur.ath.cx --- This seems to be a subset of https://issues.dlang.org/show_bug.cgi?id=10762 --
[Issue 6447] iota(BigInt) too
https://issues.dlang.org/show_bug.cgi?id=6447 --- Comment #5 from bearophile_h...@eml.cc --- A workaround: 10.iota.map!BigInt --
[Issue 6447] iota(BigInt) too
https://issues.dlang.org/show_bug.cgi?id=6447 --- Comment #6 from hst...@quickfur.ath.cx --- That doesn't help when you actually *need* a BigInt, e.g., iota(BigInt(2)^^65536). Of course, you'd run into other problems with that (e.g., you'll be waiting a looong time for your program to finish), but the idea is that you want to iterate over numbers that only BigInt can represent, right? --
[Issue 6447] iota(BigInt) too
https://issues.dlang.org/show_bug.cgi?id=6447 --- Comment #7 from bearophile_h...@eml.cc --- (In reply to hsteoh from comment #6) That doesn't help when you actually *need* a BigInt, e.g., iota(BigInt(2)^^65536). Of course, you'd run into other problems with that (e.g., you'll be waiting a looong time for your program to finish), but the idea is that you want to iterate over numbers that only BigInt can represent, right? The idea is that I'd like iota(BigInt(10)) to work. In the meantime I use some workarounds. --
[Issue 6447] iota(BigInt) too
https://issues.dlang.org/show_bug.cgi?id=6447 --- Comment #9 from bearophile_h...@eml.cc --- (In reply to hsteoh from comment #8) Yes, but if BigInt(10) should work, then BigInt(2)^^65536 should work too. I don't think you'd like it if the library imposed some arbitrary subrange on your numeric types that may be used with iota (what if iota(10) worked but iota(11) didn't?). Yes, of course. I'd like iota to work with bigints in general :-) --
[Issue 6447] iota(BigInt) too
http://d.puremagic.com/issues/show_bug.cgi?id=6447 hst...@quickfur.ath.cx changed: What|Removed |Added CC||hst...@quickfur.ath.cx --- Comment #4 from hst...@quickfur.ath.cx 2013-08-18 22:39:52 PDT --- Related: issue #10762. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 6447] iota(BigInt) too
http://d.puremagic.com/issues/show_bug.cgi?id=6447 Russel Winder rus...@winder.org.uk changed: What|Removed |Added CC||rus...@winder.org.uk --- Comment #2 from Russel Winder rus...@winder.org.uk 2013-05-28 11:37:57 BST --- I don't have the time, and likely not the knowledge, to fix this and provide a pull request. Is there anyone who does? This is a two year old problem that means D is not useful for applications using data types other than the hardware types, which is a lot of applications. Is this a symptom of the fact that Phobos is really predicated on use of hardware types more generally? (This comment is really to get me on the cc list as there seems to be a requirement to make a comment in order to add oneself to the cc list :-(( -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 6447] iota(BigInt) too
http://d.puremagic.com/issues/show_bug.cgi?id=6447 --- Comment #3 from bearophile_h...@eml.cc 2013-05-28 04:15:16 PDT --- (In reply to comment #2) Is this a symptom of the fact that Phobos is really predicated on use of hardware types more generally? I think it's mostly a symptom of D/Phobos not having many contributors :-) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 6447] iota(BigInt) too
http://d.puremagic.com/issues/show_bug.cgi?id=6447 Jonathan M Davis jmdavisp...@gmx.com changed: What|Removed |Added CC||jmdavisp...@gmx.com --- Comment #1 from Jonathan M Davis jmdavisp...@gmx.com 2011-08-06 20:05:50 PDT --- BigInt isn't considered an integral by isIntegral, hence why it doesn't work. We should probably look at having a template in std.traits which covers both the built-in integral types and BigInt so that those functions which can work with both have an easy way to test for it. It's either that or every function that could use BigInt is going to have to test for it explicitly on top of testing for isIntegral. Regardless, I don't see any reason why using iota with BigInt shouldn't be made to work. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---