Re: conver BigInt to string

2015-11-06 Thread Namal via Digitalmars-d-learn
On Thursday, 5 November 2015 at 17:40:12 UTC, bearophile wrote: Namal: Hello I am trying to convert BigInt to string like that while trying to sort it: void main() { import std.stdio, std.algorithm, std.conv, std.bigint, std.string; auto n = 17.BigInt ^^ 179;

Re: conver BigInt to string

2015-11-06 Thread cym13 via Digitalmars-d-learn
On Friday, 6 November 2015 at 10:00:23 UTC, Namal wrote: On Thursday, 5 November 2015 at 17:40:12 UTC, bearophile wrote: Namal: Hello I am trying to convert BigInt to string like that while trying to sort it: void main() { import std.stdio, std.algorithm, std.conv, std.bigint,

Re: conver BigInt to string

2015-11-05 Thread Meta via Digitalmars-d-learn
On Thursday, 5 November 2015 at 16:29:30 UTC, Namal wrote: Hello I am trying to convert BigInt to string like that while trying to sort it: string s1 = to!string(a).dup.sort; and get an error cannot implicitly convert expression (_adSortChar(dup(to(a of type char[] to string what do I

Re: conver BigInt to string

2015-11-05 Thread Namal via Digitalmars-d-learn
On Thursday, 5 November 2015 at 16:35:01 UTC, BBasile wrote: On Thursday, 5 November 2015 at 16:29:30 UTC, Namal wrote: Hello I am trying to convert BigInt to string like that while trying to sort it: string s1 = to!string(a).dup.sort; and get an error cannot implicitly convert expression

Re: conver BigInt to string

2015-11-05 Thread Namal via Digitalmars-d-learn
On Thursday, 5 November 2015 at 17:13:07 UTC, Ilya Yaroshenko wrote: string s1 = to!string(a).dup.sort.idup; well, but I was just told not to use sort ??

Re: conver BigInt to string

2015-11-05 Thread Namal via Digitalmars-d-learn
On Thursday, 5 November 2015 at 16:45:10 UTC, Meta wrote: On Thursday, 5 November 2015 at 16:29:30 UTC, Namal wrote: Hello I am trying to convert BigInt to string like that while trying to sort it: string s1 = to!string(a).dup.sort; and get an error cannot implicitly convert expression

Re: conver BigInt to string

2015-11-05 Thread BBasile via Digitalmars-d-learn
On Thursday, 5 November 2015 at 16:39:03 UTC, Namal wrote: On Thursday, 5 November 2015 at 16:35:01 UTC, BBasile wrote: On Thursday, 5 November 2015 at 16:29:30 UTC, Namal wrote: Hello I am trying to convert BigInt to string like that while trying to sort it: string s1 =

Re: conver BigInt to string

2015-11-05 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Thursday, 5 November 2015 at 16:53:50 UTC, Namal wrote: On Thursday, 5 November 2015 at 16:45:10 UTC, Meta wrote: On Thursday, 5 November 2015 at 16:29:30 UTC, Namal wrote: Hello I am trying to convert BigInt to string like that while trying to sort it: string s1 = to!string(a).dup.sort;

Re: conver BigInt to string

2015-11-05 Thread BBasile via Digitalmars-d-learn
On Thursday, 5 November 2015 at 16:29:30 UTC, Namal wrote: Hello I am trying to convert BigInt to string like that while trying to sort it: string s1 = to!string(a).dup.sort; and get an error cannot implicitly convert expression (_adSortChar(dup(to(a of type char[] to string what do I

Re: conver BigInt to string

2015-11-05 Thread bearophile via Digitalmars-d-learn
Namal: Hello I am trying to convert BigInt to string like that while trying to sort it: void main() { import std.stdio, std.algorithm, std.conv, std.bigint, std.string; auto n = 17.BigInt ^^ 179; n.text.dup.representation.sort().release.assumeUTF.writeln; } Bye, bearophile

Re: conver BigInt to string

2015-11-05 Thread bearophile via Digitalmars-d-learn
void main() { import std.stdio, std.algorithm, std.conv, std.bigint, std.string; auto n = 17.BigInt ^^ 179; n.text.dup.representation.sort().release.assumeUTF.writeln; } Better: n.to!(char[]).representation.sort().release.assumeUTF.writeln; Bye, bearophile

Re: bearophile is back! :) was: Re: conver BigInt to string

2015-11-05 Thread Chris via Digitalmars-d-learn
On Thursday, 5 November 2015 at 19:38:23 UTC, Ali Çehreli wrote: Good one! ;) I'm really happy that he is still around. Ali So am I! The more, the merrier!

bearophile is back! :) was: Re: conver BigInt to string

2015-11-05 Thread Ali Çehreli via Digitalmars-d-learn
On 11/05/2015 09:40 AM, bearophile wrote: Bye, bearophile Were you immersed in another language? Rust? Ali

Re: bearophile is back! :) was: Re: conver BigInt to string

2015-11-05 Thread Ali Çehreli via Digitalmars-d-learn
On 11/05/2015 11:35 AM, Chris wrote: On Thursday, 5 November 2015 at 19:30:02 UTC, Ali Çehreli wrote: On 11/05/2015 09:40 AM, bearophile wrote: Bye, bearophile Were you immersed in another language? Rust? Ali His D doesn't seem to be Rusty though! Good one! ;) I'm really happy that he

Re: bearophile is back! :) was: Re: conver BigInt to string

2015-11-05 Thread Chris via Digitalmars-d-learn
On Thursday, 5 November 2015 at 19:30:02 UTC, Ali Çehreli wrote: On 11/05/2015 09:40 AM, bearophile wrote: Bye, bearophile Were you immersed in another language? Rust? Ali His D doesn't seem to be Rusty though!

Re: conver BigInt to string

2015-11-05 Thread TheGag96 via Digitalmars-d-learn
On Thursday, 5 November 2015 at 16:45:10 UTC, Meta wrote: The second issue is that using .sort instead of .sort() (note the parentheses) calls the built-in sort instead of std.algorithm.sort, which is strongly discouraged. You should always use std.algorithm.sort over the built-in sort, which

Re: conver BigInt to string

2015-11-05 Thread Meta via Digitalmars-d-learn
On Thursday, 5 November 2015 at 20:45:45 UTC, TheGag96 wrote: Whoa whoa whoa... This is the first time I've heard about this difference, and I've used .sort plenty of times... That seems like really, REALLY bad design, especially considering the language allows functions to be called without