Re: Best practice for dub registry package and module names

2022-09-03 Thread Mathias LANG via Digitalmars-d-learn
On Sunday, 4 September 2022 at 01:52:11 UTC, Ali Çehreli wrote: Should the package be the author's name: acehreli.a, acehreli.b, and acehreli.c? I use this approach: https://forum.dlang.org/thread/jdkmtgftmwtwaxxqh...@forum.dlang.org

Re: Best practice for dub registry package and module names

2022-09-03 Thread rikki cattermole via Digitalmars-d-learn
I cannot recommend looking at how Adam has done it. I've been trying to get him to change it since he originally did it. It has known issues and yes it will still pull in all modules thanks to -I behavior except you get fun things like linker errors. Keep in mind, you are trying to

Re: Best practice for dub registry package and module names

2022-09-03 Thread Ali Çehreli via Digitalmars-d-learn
On 9/3/22 20:39, Ali Çehreli wrote: For example, there is fixedsizearray, which does not belong to any package: https://code.dlang.org/packages/fixedsizearray On the other hand, arsd-official:minigui does have a package. (And that answers a question: Dash character is acceptable in package

Re: Best practice for dub registry package and module names

2022-09-03 Thread rikki cattermole via Digitalmars-d-learn
Yeah you're over thinking this. It is a single dub package with a namespacing package directory.

Re: Best practice for dub registry package and module names

2022-09-03 Thread Ali Çehreli via Digitalmars-d-learn
On 9/3/22 20:04, rikki cattermole wrote: > This slightly smells, single module dub packages. > > What does each module do? The other issue is NIH because some of their functionality already exists. :/ A: Block of elements B: Expanding circular buffer C: Cache of elements I would like to

Re: Best practice for dub registry package and module names

2022-09-03 Thread zjh via Digitalmars-d-learn
On Sunday, 4 September 2022 at 01:52:11 UTC, Ali Çehreli wrote: Let's say I have three modules that work together, which I want to register on dub: A, B, and C. You should learn `ARSD`, and become `Ali-official`.

Re: Best practice for dub registry package and module names

2022-09-03 Thread rikki cattermole via Digitalmars-d-learn
This slightly smells, single module dub packages. What does each module do?

Best practice for dub registry package and module names

2022-09-03 Thread Ali Çehreli via Digitalmars-d-learn
Let's say I have three modules that work together, which I want to register on dub: A, B, and C. Although the most interesting one is C and A and B are used in its implementation, A and B can be registered individually as well and be used as C's dependencies. I know package-less modules are

Re: Error while generate DNA with uniform()

2022-09-03 Thread Ali Çehreli via Digitalmars-d-learn
On 9/3/22 14:18, Salih Dincer wrote: >uniform!"[]"(DNA.min, DNA.max); Even cleaner: uniform!DNA() :) Ali

Re: Error while generate DNA with uniform()

2022-09-03 Thread rassoc via Digitalmars-d-learn
On 9/3/22 23:18, Salih Dincer via Digitalmars-d-learn wrote: Clean-cut, thank you! It's very clear to me... Nothing major, but instead of `uniform!"[]"(DNA.min, DNA.max)`, you can simply use `uniform!DNA`. `uniform` considers the whole enum:

Re: Error while generate DNA with uniform()

2022-09-03 Thread Salih Dincer via Digitalmars-d-learn
On Saturday, 3 September 2022 at 21:09:09 UTC, Ali Çehreli wrote: Salih had asked: >> Can we solve this issue with our own `generate()` structure? Yes, I did the following to determine that adding Unqual was a solution: - Copy generate() functions to your source file, - Copy the Generator

Tracing out error that causes compiler crash

2022-09-03 Thread solidstate1991 via Digitalmars-d-learn
During unittest in my own fork of std.experimental.xml (link: https://github.com/ZILtoid1991/experimental.xml ), potentially an error so severe is present, that it causes to crash the compiler (both DMD and LDC2, on Windows). I was able to separate the issue by commenting out all unittests,

Re: Error while generate DNA with uniform()

2022-09-03 Thread Salih Dincer via Digitalmars-d-learn
On Saturday, 3 September 2022 at 14:25:48 UTC, Steven Schveighoffer wrote: [...] what you need anyway is a `char`, so just return a `char`. [...] Clean-cut, thank you! It's very clear to me... ```d import std; void main() { alias fp = char function() @system; enum DNA : char {

Re: Error while generate DNA with uniform()

2022-09-03 Thread Ali Çehreli via Digitalmars-d-learn
On 9/3/22 07:25, Steven Schveighoffer wrote: > There is probably a bug in generate when the element type is an `enum` > which somehow makes it const. Yes, Generator is missing an Unqual: https://issues.dlang.org/show_bug.cgi?id=23319 Salih had asked: >> Can we solve this issue with our own

Re: Forked GC explained

2022-09-03 Thread wjoe via Digitalmars-d-learn
On Saturday, 3 September 2022 at 13:35:39 UTC, frame wrote: I'm not sure I fully understand how it works. I know that the OS creates read only memory pages for both and if a memory section is about to be written, the OS will issue a copy of the pages so any write operation will be done in it's

Re: synchronized/shared associative array .require error

2022-09-03 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/2/22 3:15 PM, cc wrote: Tried casting away shared as a workaround but I assume that will cause some kind of TLS catastrophe. I think it will be fine, but you may have an issue. You are returning a non-shared `VAL`, but your class is `shared`, which means `table`, and all the `VAL`

Re: Forked GC explained

2022-09-03 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/3/22 9:35 AM, frame wrote: I'm not sure I fully understand how it works. I know that the OS creates read only memory pages for both and if a memory section is about to be written, the OS will issue a copy of the pages so any write operation will be done in it's own copy and cannot mess up

Re: Error while generate DNA with uniform()

2022-09-03 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/3/22 8:09 AM, Salih Dincer wrote: Hi All, We discovered a bug yesterday and reported it: https://forum.dlang.org/thread/mailman.1386.1662137084.31357.digitalmars-d-b...@puremagic.com You know, there is `generate()` depend to `std.range`. It created the error when we use it with the

Re: synchronized/shared associative array .require error

2022-09-03 Thread frame via Digitalmars-d-learn
On Saturday, 3 September 2022 at 09:49:54 UTC, Loara wrote: In current version of D language `synchronized` and `shared` are independent. In particular `shared` should be used only for basic types like integers for which atomic operations are well defined, and not for classes. Not exactly,

Forked GC explained

2022-09-03 Thread frame via Digitalmars-d-learn
I'm not sure I fully understand how it works. I know that the OS creates read only memory pages for both and if a memory section is about to be written, the OS will issue a copy of the pages so any write operation will be done in it's own copy and cannot mess up things. But then is the

Error while generate DNA with uniform()

2022-09-03 Thread Salih Dincer via Digitalmars-d-learn
Hi All, We discovered a bug yesterday and reported it: https://forum.dlang.org/thread/mailman.1386.1662137084.31357.digitalmars-d-b...@puremagic.com You know, there is `generate()` depend to `std.range`. It created the error when we use it with the value of an enum. Which get their values

Re: synchronized/shared associative array .require error

2022-09-03 Thread Loara via Digitalmars-d-learn
On Friday, 2 September 2022 at 19:15:45 UTC, cc wrote: ```d synchronized class SyncTable(KEY, VAL) { private VAL[KEY] table; auto require(KEY key) { return table.require(key); } } auto table = new shared SyncTable!(string, string); table.require("abc");

Re: Constructors not working

2022-09-03 Thread Mathias LANG via Digitalmars-d-learn
On Friday, 2 September 2022 at 18:35:22 UTC, Svyat wrote: I write this code in one directory: ``` module time; struct Time { public int hours, minutes, seconds; this(int h, int m, int s) { hours = h; minutes = m; seconds = s; }