Re: Parameters declared as the alias of a template won't accept the arguments of the same type.
On Monday, 2 May 2022 at 00:54:40 UTC, Elfstone wrote: Thanks. This breaks a lot of things. I don't know the reason behind the postponing, but who would expect one can't declare a parameter with an alias if it's a template?! Speaking of inconsistency. At the bottom of the DIP you can find a link to the first community review round and a summary of the feedback. You'll see the DIP author decided he needed to do more work on the it. Ultimately, he decided he didn't have a deep enough understanding to complete the DIP without some research, but he was too busy to make that investment. I suggested we mark it as postponed until he could come back to it. Reviewing our conversation, he was willing to someone else taking it over. So if anyone is willing, I don't need to wait on a response from him to make that happen. I'm sure there are bigger issues out there to be solved, but it's quite disencouraging if such a significant improvement(or rather fix) stays ignored. Everyone rates issues differently. What's significant to one person won't be to another. There is much, much work to be done on shoring up holes in existing systems and solving problems the language maintainers believe to be significant, but resources are limited. So some things will inevitably be left to one side until someone picks them up. For issues that are bugs or minor enhancements, we now have Razvan Nitu and Dennis Korpel in part-time positions funded by Symmetry Investments. They manage our issues database and our pull request queues. You can always ping one of them about any particular issue that doesn't require a DIP. This has been a huge change for the better. It means issues and PRs are much less likely to stagnate. For something like your issue, which is a modification of the specification, a DIP is required. And that means either writing one or finding someone willing to write one and see it through to the end of the process. This isn't like managing bugs and pull requests. We simply don't have enough people on board to work on things like this. So it has to be done by interested parties in the community. I wouldn't expect you to take over DIP 1023 yourself since you're new to the language, but if it's important enough to you, perhaps you can find someone to champion it, given a little time. Maybe the original author would be willing to pick it up again.
Re: Parameters declared as the alias of a template won't accept the arguments of the same type.
On Sunday, 1 May 2022 at 14:14:59 UTC, Mike Parker wrote: On Sunday, 1 May 2022 at 12:39:08 UTC, Elfstone wrote: Great, I'm using the constraint, until it's fixed. Will it be fixed though? The DIP that Tejas linked is from 2020!!! The DIP was postponed. I can contact the author to see if he intends to pick it up again. If not, anyone interested can take it over. And anyone can submit an alternative at any time. Thanks. This breaks a lot of things. I don't know the reason behind the postponing, but who would expect one can't declare a parameter with an alias if it's a template?! Speaking of inconsistency. I'm sure there are bigger issues out there to be solved, but it's quite disencouraging if such a significant improvement(or rather fix) stays ignored. I just recently started investing my spare time in D, rewriting something I wrote in C++, because the first look at D was really nice. I ran into quite a few problems and have questioned the design here and there. Fortunately (and unfortunately), this so far is the biggest issue I've run into. For now, I think I'll keep doing what I have being doing, hoping D will suit my purpose. Then I can invest more.
Re: Help with DynamicArray of Emsi Containers
On 2022-05-01 09:12, vit wrote: DynamicArray has disabled postblit (is not copyable). Package autoptr is deprecated (internaly redirected to btl:atuoptr), all functionality is moved to package [BTL](https://code.dlang.org/packages/btl) (subpackage btl:autoptr). This library contains subpackage btl:vector with functionality like DynamicArray with support for copying. I use IntrusivePtr inside Vector/SmallVector and i have no problems. Thanks a lot for those pointers, I changed/upgraded my dependencies, and it already looks better.
Re: error connecting to mongodb atlas with vibe.d
On Saturday, 30 April 2022 at 14:29:56 UTC, notsteve wrote: Hi, I am trying to setup a simple webserver in D using vibe.d (0.9.4) and want to use mongoDB as a database. To achieve this, I've set up a mongoDB atlas instance with the following command inside the standard app.d file created by vibe.d ``` string MongoURL = "mongodb://username:@cluster0-shard-00-01.gaetq.mongodb.net:27017"; auto client = connectMongoDB(MongoURL); ``` but am getting error [1] below. Alternatively if I use the following path to the instance ``` string MongoURL = "mongodb://username:passw...@cluster0-shard-00-01.gaetq.mongodb.net:27017/myFirstDatabase?ssl=true=false"; ``` I get error [2]. I have tried accessing this instance using other programming languages and am not having any issues so am sure it is not an issue with the database instance. Does anyone have experience with this? Error 1: ``` object.Exception@../../../.dub/packages/vibe-core-1.22.3/vibe-core/source/vibe/core/net.d(777): Reached end of stream while reading data. ``` https://github.com/vibe-d/vibe-core/blob/v1.22.3/source/vibe/core/net.d#L777 Apparently, no data is received anymore within the remaining time duration. Error 2: ``` object.Exception@../../../.dub/packages/vibe-d-0.9.4/vibe-d/data/vibe/data/bson.d(813): BSON value is type 'int_', expected to be one of [double_] ``` https://github.com/vibe-d/vibe.d/blob/v0.9.4/data/vibe/data/bson.d#L813 There is clearly something wrong with the type expected and provided. Check the schemes/layouts.
Re: Parameters declared as the alias of a template won't accept the arguments of the same type.
On Sunday, 1 May 2022 at 12:39:08 UTC, Elfstone wrote: Great, I'm using the constraint, until it's fixed. Will it be fixed though? The DIP that Tejas linked is from 2020!!! The DIP was postponed. I can contact the author to see if he intends to pick it up again. If not, anyone interested can take it over. And anyone can submit an alternative at any time.
Re: Parameters declared as the alias of a template won't accept the arguments of the same type.
On Sunday, 1 May 2022 at 11:37:28 UTC, JG wrote: On Sunday, 1 May 2022 at 11:34:49 UTC, JG wrote: [...] The static assert isn't needed. ```d enum isVector(V) = is(V==MatrixImpl!(S,1,N),S,size_t N); @nogc auto dot1(V)(in V lhs, in V rhs) if(isVector!V) { static if(is(V==MatrixImpl!(S,1,N),S,N)) { S ret=0; return ret; } } ``` Great, I'm using the constraint, until it's fixed. Will it be fixed though? The DIP that Tejas linked is from 2020!!!
Re: Parameters declared as the alias of a template won't accept the arguments of the same type.
On Sunday, 1 May 2022 at 11:34:49 UTC, JG wrote: On Sunday, 1 May 2022 at 07:59:57 UTC, Elfstone wrote: On Sunday, 1 May 2022 at 06:42:26 UTC, Tejas wrote: [...] Thanks a lot! So this really is a D "feature". The current behaviour is so broken. It makes no sense, for a language user at least. I don't understand why it's not yet solved, if it's a known issue. I guess the current best is something like: ```d enum isVector(V) = is(V==MatrixImpl!(S,1,N),S,size_t N); @nogc auto dot1(V)(in V lhs, in V rhs) if(isVector!V) { return dot2(lhs,rhs); } ``` or ```d enum isVector(V) = is(V==MatrixImpl!(S,1,N),S,size_t N); @nogc auto dot1(V)(in V lhs, in V rhs) if(isVector!V) { static if(is(V==MatrixImpl!(S,1,N),S,N)) { S ret=0; return ret; } static assert("This should never been shown"); } ``` The static assert isn't needed. ```d enum isVector(V) = is(V==MatrixImpl!(S,1,N),S,size_t N); @nogc auto dot1(V)(in V lhs, in V rhs) if(isVector!V) { static if(is(V==MatrixImpl!(S,1,N),S,N)) { S ret=0; return ret; } } ```
Re: Parameters declared as the alias of a template won't accept the arguments of the same type.
On Sunday, 1 May 2022 at 07:59:57 UTC, Elfstone wrote: On Sunday, 1 May 2022 at 06:42:26 UTC, Tejas wrote: On Sunday, 1 May 2022 at 03:57:12 UTC, Elfstone wrote: module test; struct MatrixImpl(S, size_t M, size_t N) { } [...] AFAICT, I'm afraid you'll have to stick to `dot2` This DIP I believe does what you want but... It wasn't looked upon favorably... https://github.com/dlang/DIPs/blob/master/DIPs/other/DIP1023.md Thanks a lot! So this really is a D "feature". The current behaviour is so broken. It makes no sense, for a language user at least. I don't understand why it's not yet solved, if it's a known issue. I guess the current best is something like: ```d enum isVector(V) = is(V==MatrixImpl!(S,1,N),S,size_t N); @nogc auto dot1(V)(in V lhs, in V rhs) if(isVector!V) { return dot2(lhs,rhs); } ``` or ```d enum isVector(V) = is(V==MatrixImpl!(S,1,N),S,size_t N); @nogc auto dot1(V)(in V lhs, in V rhs) if(isVector!V) { static if(is(V==MatrixImpl!(S,1,N),S,N)) { S ret=0; return ret; } static assert("This should never been shown"); } ```
Re: Parameters declared as the alias of a template won't accept the arguments of the same type.
On Sunday, 1 May 2022 at 06:42:26 UTC, Tejas wrote: On Sunday, 1 May 2022 at 03:57:12 UTC, Elfstone wrote: module test; struct MatrixImpl(S, size_t M, size_t N) { } [...] AFAICT, I'm afraid you'll have to stick to `dot2` This DIP I believe does what you want but... It wasn't looked upon favorably... https://github.com/dlang/DIPs/blob/master/DIPs/other/DIP1023.md Thanks a lot! So this really is a D "feature". The current behaviour is so broken. It makes no sense, for a language user at least. I don't understand why it's not yet solved, if it's a known issue.
Re: Help with DynamicArray of Emsi Containers
On Saturday, 30 April 2022 at 20:22:43 UTC, Christian Köstlin wrote: I am struggling with initializing an Emsi Containers DynamicArray in a nice way. Some background information of my usecase: I experimenting in porting some old 3d engine code of mine from c++ to dlang. In the engine I want to exactly control when resources are freed and not rely on the garbage collector. For that I am using reference counters courtesy of autoptr. e.g. ```d alias Texture = IntrusivePtr!TextureData; // dub package autoptr class TextureData { IFImage image; // dub package imagefmt } ``` another class of mine now is supposed to hold several of those textures for multitexturing and should be initialized in its constructor: ```d class Appearance { Texture[] textures; this(Texture[] textures) { this.textures = textures; } } ``` Unfortunately this does not work properly together with autoptr's (see https://github.com/submada/autoptr/issues/5#issuecomment-997683868). Because of that I am using now DynamicArrays from Emsi Containers, but I am having trouble initializing them: ```d class Apperance { DynamicArray!Texture textures; this(DynamicArray!Texture textures) { this.textures = textures; } } ``` does not compile. What would be the best way to initialize the variable? Kind regards, Christian DynamicArray has disabled postblit (is not copyable). Package autoptr is deprecated (internaly redirected to btl:atuoptr), all functionality is moved to package [BTL](https://code.dlang.org/packages/btl) (subpackage btl:autoptr). This library contains subpackage btl:vector with functionality like DynamicArray with support for copying. I use IntrusivePtr inside Vector/SmallVector and i have no problems.
Re: Parameters declared as the alias of a template won't accept the arguments of the same type.
On Sunday, 1 May 2022 at 03:57:12 UTC, Elfstone wrote: module test; struct MatrixImpl(S, size_t M, size_t N) { } [...] AFAICT, I'm afraid you'll have to stick to `dot2` This DIP I believe does what you want but... It wasn't looked upon favorably... https://github.com/dlang/DIPs/blob/master/DIPs/other/DIP1023.md
Re: error connecting to mongodb atlas with vibe.d
On Saturday, 30 April 2022 at 14:29:56 UTC, notsteve wrote: Hi, I am trying to setup a simple webserver in D using vibe.d (0.9.4) and want to use mongoDB as a database. To achieve this, I've set up a mongoDB atlas instance with the following command inside the standard app.d file created by vibe.d [...] Don't know if this will help or not, but someone wrote a book explaining vibed (and it's pretty recent too), maybe it'll contain some info regarding your issue https://github.com/reyvaleza/vibed/blob/main/BuildWebAppsinVibe.pdf Hope it helps!