Re: Looking for an equivalent to C++ std::getline in D

2017-05-10 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, May 09, 2017 21:37:19 Moritz Maxeiner via Digitalmars-d-learn wrote: > On Tuesday, 9 May 2017 at 19:11:08 UTC, Jonathan M Davis wrote: > > LOL. I get the impression that it's often the tendancy of D > > folks is to get excited when D shows up as high in a list like > > Tiobe and to arg

Re: Looking for an equivalent to C++ std::getline in D

2017-05-10 Thread k-five via Digitalmars-d-learn
On Wednesday, 10 May 2017 at 10:47:13 UTC, Ali Çehreli wrote: On 05/09/2017 01:17 AM, k-five wrote: > On Monday, 8 May 2017 at 21:37:17 UTC, Ali Çehreli wrote: >> On 05/06/2017 02:24 AM, Stanislav Blinov wrote: >> Plus, wrapping steps of the same

Re: Looking for an equivalent to C++ std::getline in D

2017-05-10 Thread Ali Çehreli via Digitalmars-d-learn
On 05/09/2017 01:17 AM, k-five wrote: > On Monday, 8 May 2017 at 21:37:17 UTC, Ali Çehreli wrote: >> On 05/06/2017 02:24 AM, Stanislav Blinov wrote: >> > > It may D has this philosophy as Perl has: There's more than one way to > do it D certainly d

Re: Looking for an equivalent to C++ std::getline in D

2017-05-09 Thread Moritz Maxeiner via Digitalmars-d-learn
On Tuesday, 9 May 2017 at 19:11:08 UTC, Jonathan M Davis wrote: LOL. I get the impression that it's often the tendancy of D folks is to get excited when D shows up as high in a list like Tiobe and to argue that the list doesn't mean much if D isn't high in the list. AKA confirmation bias. Not

Re: Looking for an equivalent to C++ std::getline in D

2017-05-09 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, May 08, 2017 11:41:02 Daniel N via Digitalmars-d-learn wrote: > On Monday, 8 May 2017 at 10:51:52 UTC, Ola Fosheim Grøstad wrote: > > On Sunday, 7 May 2017 at 20:50:10 UTC, Patrick Schluter wrote: > >> If you look on TIOBE [1] newest stats, D does not look so bad > >> after all. It's ran

Re: Looking for an equivalent to C++ std::getline in D

2017-05-09 Thread k-five via Digitalmars-d-learn
On Monday, 8 May 2017 at 21:37:17 UTC, Ali Çehreli wrote: On 05/06/2017 02:24 AM, Stanislav Blinov wrote: It may D has this philosophy as Perl has: There's more than one way to do it I found more than 5 ways. another way: string[] input = [

Re: Looking for an equivalent to C++ std::getline in D

2017-05-08 Thread Ali Çehreli via Digitalmars-d-learn
On 05/06/2017 02:24 AM, Stanislav Blinov wrote: > auto input = args[1].splitter('/').filter!((string s) { return !s.empty; > })(); > > or a template lambda: > > auto input = arga[1].splitter('/').filter!((s) => !s.empty)(); Not necessarily better but worth mentioning: import std.functional

Re: Looking for an equivalent to C++ std::getline in D

2017-05-08 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Monday, 8 May 2017 at 11:41:02 UTC, Daniel N wrote: Stack-Overflow usage is clearly not representative of language usage. 1) Our forum is flourishing, why would any D developer use SO? 2) The number of questions is directly proportional with the difficulty of the language.(D is quite easy to

Re: Looking for an equivalent to C++ std::getline in D

2017-05-08 Thread Daniel N via Digitalmars-d-learn
On Monday, 8 May 2017 at 10:51:52 UTC, Ola Fosheim Grøstad wrote: On Sunday, 7 May 2017 at 20:50:10 UTC, Patrick Schluter wrote: If you look on TIOBE [1] newest stats, D does not look so bad after all. It's ranked 23 with a 1.38% share. The so Tiobe is a "hoax". Stack overflow counts for alte

Re: Looking for an equivalent to C++ std::getline in D

2017-05-08 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
Here is another metric, number of star the main compiler has on github: Chapel: 437 Coq: 618 Ocaml: 1,258 Dmd: 1,574 Haxe: 1,865 Nim: 3,598 Crystal: 8,064 Scala: 8,158 Julia: 8,569 Rust: 21,684 TypeScript: 21,748 Go: 27,702

Re: Looking for an equivalent to C++ std::getline in D

2017-05-08 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Sunday, 7 May 2017 at 20:50:10 UTC, Patrick Schluter wrote: If you look on TIOBE [1] newest stats, D does not look so bad after all. It's ranked 23 with a 1.38% share. The so Tiobe is a "hoax". Stack overflow counts for alternative languages: "swift": 146,374 "scala": 65,594 "go": 22,212 "

Re: Looking for an equivalent to C++ std::getline in D

2017-05-08 Thread k-five via Digitalmars-d-learn
On Sunday, 7 May 2017 at 20:50:10 UTC, Patrick Schluter wrote: On Sunday, 7 May 2017 at 13:16:16 UTC, bachmeier wrote: On Sunday, 7 May 2017 at 10:33:25 UTC, k-five wrote: --- When I want to learn to code, I asked in some forums about it, an

Re: Looking for an equivalent to C++ std::getline in D

2017-05-07 Thread Patrick Schluter via Digitalmars-d-learn
On Sunday, 7 May 2017 at 13:16:16 UTC, bachmeier wrote: On Sunday, 7 May 2017 at 10:33:25 UTC, k-five wrote: Although I found D for being more better, nicer,and fun than C++ is, but there is a few questions on Stack-Over-Flow, videos on Youtube, and some other forums in my country. So, why D

Re: Looking for an equivalent to C++ std::getline in D

2017-05-07 Thread Patrick Schluter via Digitalmars-d-learn
On Sunday, 7 May 2017 at 12:29:20 UTC, Stanislav Blinov wrote: On Sunday, 7 May 2017 at 10:33:25 UTC, k-five wrote: [...] Because everyone is asking this question instead of actually doing something about it :) To be fair, D has a good amount of usage even today, it's just not being screamed

Re: Looking for an equivalent to C++ std::getline in D

2017-05-07 Thread bachmeier via Digitalmars-d-learn
On Sunday, 7 May 2017 at 10:33:25 UTC, k-five wrote: Although I found D for being more better, nicer,and fun than C++ is, but there is a few questions on Stack-Over-Flow, videos on Youtube, and some other forums in my country. So, why D is not popular? If by popular you mean C++ or Java lev

Re: Looking for an equivalent to C++ std::getline in D

2017-05-07 Thread Stanislav Blinov via Digitalmars-d-learn
On Sunday, 7 May 2017 at 10:33:25 UTC, k-five wrote: On Sunday, 7 May 2017 at 09:46:22 UTC, Patrick Schluter wrote: On Saturday, 6 May 2017 at 10:15:03 UTC, k-five wrote: If you want to learn the basis of the range concept and their link to C++ Iterators, you should definitively read Andrei's

Re: Looking for an equivalent to C++ std::getline in D

2017-05-07 Thread k-five via Digitalmars-d-learn
On Sunday, 7 May 2017 at 09:46:22 UTC, Patrick Schluter wrote: On Saturday, 6 May 2017 at 10:15:03 UTC, k-five wrote: If you want to learn the basis of the range concept and their link to C++ Iterators, you should definitively read Andrei's article on them in the InformIT magazine. Here is th

Re: Looking for an equivalent to C++ std::getline in D

2017-05-07 Thread Patrick Schluter via Digitalmars-d-learn
On Saturday, 6 May 2017 at 10:15:03 UTC, k-five wrote: Although I am not sure but it may Range in D, has the same concept that C++ has on iterator, like InputIterator or OutputIterator, since I realized that the output of [ filter ] does not have RandomAccessRange so I can not use input[ 0 ].

Re: Looking for an equivalent to C++ std::getline in D

2017-05-06 Thread k-five via Digitalmars-d-learn
On Saturday, 6 May 2017 at 10:35:05 UTC, Stanislav Blinov wrote: On Saturday, 6 May 2017 at 10:15:03 UTC, k-five wrote: On Saturday, 6 May 2017 at 08:53:12 UTC, Jonathan M Davis wrote: On Saturday, May 6, 2017 8:34:11 AM CEST k-five via Digitalmars-d-learn wrote: On Friday, 5 May 2017 at 17:07:

Re: Looking for an equivalent to C++ std::getline in D

2017-05-06 Thread Stanislav Blinov via Digitalmars-d-learn
On Saturday, 6 May 2017 at 10:15:03 UTC, k-five wrote: On Saturday, 6 May 2017 at 08:53:12 UTC, Jonathan M Davis wrote: On Saturday, May 6, 2017 8:34:11 AM CEST k-five via Digitalmars-d-learn wrote: On Friday, 5 May 2017 at 17:07:25 UTC, Stanislav Blinov wrote: > On Friday, 5 May 2017 at 09:54:

Re: Looking for an equivalent to C++ std::getline in D

2017-05-06 Thread k-five via Digitalmars-d-learn
On Saturday, 6 May 2017 at 08:53:12 UTC, Jonathan M Davis wrote: On Saturday, May 6, 2017 8:34:11 AM CEST k-five via Digitalmars-d-learn wrote: On Friday, 5 May 2017 at 17:07:25 UTC, Stanislav Blinov wrote: > On Friday, 5 May 2017 at 09:54:03 UTC, k-five wrote:

Re: Looking for an equivalent to C++ std::getline in D

2017-05-06 Thread Stanislav Blinov via Digitalmars-d-learn
On Saturday, 6 May 2017 at 08:34:11 UTC, k-five wrote: Also what is the parameter "a.empty" for template filter Jonathan covered the type part. As for that last bit, the filter template takes a predicate as parameter. This predicate is called for each input element, and if returns false, the

Re: Looking for an equivalent to C++ std::getline in D

2017-05-06 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, May 6, 2017 8:34:11 AM CEST k-five via Digitalmars-d-learn wrote: > On Friday, 5 May 2017 at 17:07:25 UTC, Stanislav Blinov wrote: > > On Friday, 5 May 2017 at 09:54:03 UTC, k-five wrote: > == > > Thanks. > I only needed this part si

Re: Looking for an equivalent to C++ std::getline in D

2017-05-06 Thread k-five via Digitalmars-d-learn
On Friday, 5 May 2017 at 17:07:25 UTC, Stanislav Blinov wrote: On Friday, 5 May 2017 at 09:54:03 UTC, k-five wrote: == Thanks. I only needed this part since it filters the empty elements and this is enough for me: auto input = args[1].split

Re: Looking for an equivalent to C++ std::getline in D

2017-05-05 Thread Stanislav Blinov via Digitalmars-d-learn
On Friday, 5 May 2017 at 09:54:03 UTC, k-five wrote: Hi all. I have a simple command-line program utility in C++ that can rename or remove files, based on regular expression. After finding D that is more fun than C++ is, I want to port the code, but I have problem with this part of it:

Looking for an equivalent to C++ std::getline in D

2017-05-05 Thread k-five via Digitalmars-d-learn
Hi all. I have a simple command-line program utility in C++ that can rename or remove files, based on regular expression. After finding D that is more fun than C++ is, I want to port the code, but I have problem with this part of it: std::getline( iss, match, delimiter ); std::