Re: append - too many files

2023-01-10 Thread Joel via Digitalmars-d-learn
On Wednesday, 11 January 2023 at 06:00:26 UTC, Salih Dincer wrote: On Wednesday, 11 January 2023 at 02:15:13 UTC, Joel wrote: I get this error after a while (seems append doesn't close the file each time): There is no error in the function or Phobos. There may be another error on your system

Re: append - too many files

2023-01-10 Thread Salih Dincer via Digitalmars-d-learn
On Wednesday, 11 January 2023 at 02:15:13 UTC, Joel wrote: I get this error after a while (seems append doesn't close the file each time): There is no error in the function or Phobos. There may be another error on your system or depending on how you use it. Could it be that more than one pr

Re: append - too many files

2023-01-10 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Jan 11, 2023 at 02:15:13AM +, Joel via Digitalmars-d-learn wrote: > I get this error after a while (seems append doesn't close the file > each time): > std.file.FileException@std/file.d(836): history.txt: Too many open files > > ```d > auto jm_addToHistory(T...)(T args) { > impor

append - too many files

2023-01-10 Thread Joel via Digitalmars-d-learn
I get this error after a while (seems append doesn't close the file each time): std.file.FileException@std/file.d(836): history.txt: Too many open files ```d auto jm_addToHistory(T...)(T args) { import std.conv : text; import std.file : append; auto txt = text(args);

Re: Coding Challenges - Dlang or Generic

2023-01-10 Thread Paul via Digitalmars-d-learn
On Tuesday, 10 January 2023 at 01:31:28 UTC, Ali Çehreli wrote: On 1/9/23 16:17, Paul wrote: > coding challenges Perhaps the following two? https://rosettacode.org/ https://adventofcode.com/ Ali Excellent. Thanks.

Re: Coding Challenges - Dlang or Generic

2023-01-10 Thread Paul via Digitalmars-d-learn
On Tuesday, 10 January 2023 at 06:45:40 UTC, Siarhei Siamashka wrote: ... What kind of D class is that? Are you learning D language in a school or university? Or is it some kind of online language course? ... I don't know if there are rules about sharing links and such but its a site called

Re: Coding Challenges - Dlang or Generic

2023-01-10 Thread monkyyy via Digitalmars-d-learn
On Tuesday, 10 January 2023 at 19:10:09 UTC, Christian Köstlin wrote: On 10.01.23 01:17, Paul wrote: There is also https://exercism.org/tracks/d with some tasks for dlang. Kind regards, Christian Its all converted code; worthless

Re: Coding Challenges - Dlang or Generic

2023-01-10 Thread matheus via Digitalmars-d-learn
On Tuesday, 10 January 2023 at 22:10:57 UTC, Paul wrote: ... I think you must have done a blog post or tutorial or something, Teoh, because I've seen this before. Don't let this go to your head :), but I was blown away by the presentation and solution! BTW where is it posted? ITT: https://

Re: Coding Challenges - Dlang or Generic

2023-01-10 Thread Paul via Digitalmars-d-learn
On Tuesday, 10 January 2023 at 01:22:33 UTC, H. S. Teoh wrote: ... Here's a challenge. Given an input year, for example, "2023", write a program that outputs (for the corresponding year): ... Code will be graded on readability, unittest coverage, and reusability (how many functions have

Re: Coding Challenges - Dlang or Generic

2023-01-10 Thread Christian Köstlin via Digitalmars-d-learn
On 10.01.23 01:17, Paul wrote: There is also https://exercism.org/tracks/d with some tasks for dlang. Kind regards, Christian

Re: Coding Challenges - Dlang or Generic

2023-01-10 Thread monkyyy via Digitalmars-d-learn
On Tuesday, 10 January 2023 at 00:17:18 UTC, Paul wrote: I know. Someone's going to say why don't YOU do it:) https://github.com/crazymonkyyy/dingbats I could use contributors

Re: Coding Challenges - Dlang or Generic

2023-01-10 Thread bachmeier via Digitalmars-d-learn
On Tuesday, 10 January 2023 at 01:22:33 UTC, H. S. Teoh wrote: Here's a challenge. Given an input year, for example, "2023", write a program that outputs (for the corresponding year): snip- 2023

Re: Coding Challenges - Dlang or Generic

2023-01-10 Thread Salih Dincer via Digitalmars-d-learn
On Tuesday, 10 January 2023 at 10:58:37 UTC, matheus wrote: On Tuesday, 10 January 2023 at 07:38:31 UTC, Salih Dincer wrote: You don't need validDate. Because there is daysInMonth: That's really better. thanks for the info. Actually, I should thank you. When I first wrote these codes, I c

Re: enum functions

2023-01-10 Thread Adam D Ruppe via Digitalmars-d-learn
On Sunday, 8 January 2023 at 18:42:58 UTC, Salih Dincer wrote: I'm wondering 2 things; firstly, does having an enum mean there is no auto-return? Or could it be CTFE? It means nothing. The keyword tells the parser a function is about to begin, which triggers return type inference (exactly the

Re: Coding Challenges - Dlang or Generic

2023-01-10 Thread matheus via Digitalmars-d-learn
On Tuesday, 10 January 2023 at 11:23:15 UTC, drug007 wrote: 10.01.2023 13:57, matheus пишет: ... [To clarify the situation](https://wiki.dlang.org/Component_programming_with_ranges) (H S Teoh is the author of this article) Hmm very interesting (I'm at work and I just gave it a glimpse). But

Re: Coding Challenges - Dlang or Generic

2023-01-10 Thread drug007 via Digitalmars-d-learn
10.01.2023 14:23, drug007 пишет: 10.01.2023 13:57, matheus пишет: On Tuesday, 10 January 2023 at 05:21:15 UTC, H. S. Teoh wrote: Printing it in this format is trivial, and not very interesting.  The interest in the challenge is to lay it out like I posted, side-by-side,... Like I said I di

Re: Coding Challenges - Dlang or Generic

2023-01-10 Thread drug007 via Digitalmars-d-learn
10.01.2023 13:57, matheus пишет: On Tuesday, 10 January 2023 at 05:21:15 UTC, H. S. Teoh wrote: Printing it in this format is trivial, and not very interesting.  The interest in the challenge is to lay it out like I posted, side-by-side,... Like I said I did it over D online compiler which

Re: Coding Challenges - Dlang or Generic

2023-01-10 Thread matheus via Digitalmars-d-learn
On Tuesday, 10 January 2023 at 07:38:31 UTC, Salih Dincer wrote: On Tuesday, 10 January 2023 at 03:18:54 UTC, matheus wrote: ...` You don't need validDate. Because there is daysInMonth: ... That's really better. thanks for the info. Matheus.

Re: Coding Challenges - Dlang or Generic

2023-01-10 Thread matheus via Digitalmars-d-learn
On Tuesday, 10 January 2023 at 05:21:15 UTC, H. S. Teoh wrote: Printing it in this format is trivial, and not very interesting. The interest in the challenge is to lay it out like I posted, side-by-side,... Like I said I did it over D online compiler which unfortunately I couldn't validate