Re: How to convert a string command line argument to an int?

2022-03-02 Thread MoonlightSentinel via Digitalmars-d-learn
On Thursday, 3 March 2022 at 07:32:24 UTC, BoQsc wrote: I tried to use `std.conv.parse(args[2])`, [...] But I'm getting this error The code doesn't declare the type to be parsed, use `parse!uint(...)`. But `to!uint` seems more appropriate for your code because `parse` ignores non-number

How to convert a string command line argument to an int?

2022-03-02 Thread BoQsc via Digitalmars-d-learn
I tried to use `std.conv.parse(args[2])`, ``` import std.stdio; import std.conv; void main(string[] args){ if (args.length > 1) { writeln(broadcastSettingChange(args[1])); if (args.length == 2) { // TODO: second argument needs parse to

Re: How do I create a package?

2022-03-02 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 2 March 2022 at 16:38:58 UTC, M wrote: There doesn't seem to be any docs on how to actually create packages. Is there a description anywhere? In case you're talking about a language-level package and not a dub package, just create a directory in your source tree with the name

Re: How do I create a package?

2022-03-02 Thread Anonymouse via Digitalmars-d-learn
On Wednesday, 2 March 2022 at 16:38:58 UTC, M wrote: There doesn't seem to be any docs on how to actually create packages. Is there a description anywhere? https://dub.pm/getting_started.html is it, I think. It should get you started on creating a package, and then you have

How do I create a package?

2022-03-02 Thread M via Digitalmars-d-learn
There doesn't seem to be any docs on how to actually create packages. Is there a description anywhere?

Re: gcopt=fork:1

2022-03-02 Thread Ali Çehreli via Digitalmars-d-learn
On 3/2/22 07:11, Anonymouse wrote: > It didn't work well for me; the process hung in > `__memcpy_avx_unaligned_erms` when profiling under valgrind/callgrind, > during the first collection. And it showed worse pause performance in a micro-benchmark program that I wrote that ran only for 10

Re: What does dual-context mean?

2022-03-02 Thread wjoe via Digitalmars-d-learn
On Tuesday, 1 March 2022 at 17:58:24 UTC, Paul Backus wrote: On Tuesday, 1 March 2022 at 14:51:47 UTC, wjoe wrote: Hello, what's a dual context as in the deprecation message? It means you have a struct or class member function that accesses its calling context via a template alias

Re: gcopt=fork:1

2022-03-02 Thread Anonymouse via Digitalmars-d-learn
On Tuesday, 1 March 2022 at 21:32:07 UTC, Ali Çehreli wrote: Have you tried this new GC option which seems to solve the stop-the-world issue: https://dlang.org/changelog/2.098.0.html#forkgc Any experience? Ali It didn't work well for me; the process hung in `__memcpy_avx_unaligned_erms`