curl error msg

2022-02-19 Thread MichaelBi via Digitalmars-d-learn
when running the example in the std.net.curl on my windows, got following msg: std.net.curl.CurlException@std\net\curl.d(4239): Failed to load curl, tried "libcurl.dll", "curl.dll" does it mean i don't have those dll files? thx.

Tips on TCP socket to postgresql middleware

2022-02-19 Thread Chris Piker via Digitalmars-d-learn
Hi D I'm about to start a small program to whose job is: 1. Connect to a server over a TCP socket 2. Read a packetized real-time data stream 3. Update/insert to a postgresql database as data arrive. In general it should buffer data in RAM to avoid exerting back pressure on the input socket and

Function Parameters without Names?

2022-02-19 Thread Vijay Nayar via Digitalmars-d-learn
I encountered an odd bug in a project of mine which is illustrated in the example below: ```d class Thing { int val; this(int) { this.val = val; } } void main() { auto t = new Thing(3); assert(t.val != 3); } ``` The problem is that the parameter of the constructor actually has n

Re: Function Parameters without Names?

2022-02-19 Thread Ali Çehreli via Digitalmars-d-learn
On 2/19/22 15:37, Vijay Nayar wrote: > The problem is that the parameter of the constructor actually has no > name at all. Thus, the statement `this.val = val` simply sets the member > variable to its own value Wow! I've never come accross that one before. :) > What is the main motivator to all

Re: Function Parameters without Names?

2022-02-19 Thread Salih Dincer via Digitalmars-d-learn
On Saturday, 19 February 2022 at 23:37:01 UTC, Vijay Nayar wrote: What is the main motivator to allow parameters with no names? Do they get an automatic implied name like `_` or something? The problem was about [here](https://dlang.org/spec/class.html#constructors), it should not be type in