Re: Memory management

2020-10-02 Thread Dukc via Digitalmars-d-learn
On Tuesday, 29 September 2020 at 10:57:07 UTC, novice3 wrote: Naive newbie question: Can we have (in theory) in D lang memory management like V lang? I don't know V so can't be sure, but doing it the same way as in the examples sounds possible. The first two calls are easy. D string literals

Re: Whats going on with this?

2020-10-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On 10/2/20 7:28 PM, claptrap wrote: Why would putting in the writeln cause it to fail? Is it maybe trying to create the foo at compile time? Yes, it is. Any static initialization of static variables happens at compile-time. https://dlang.org/spec/declaration.html#global_static_init -Stev

Whats going on with this?

2020-10-02 Thread claptrap via Digitalmars-d-learn
--- import std; import std.stdio; struct Foo { int a = 0, b = 0; this(int[2] vars) { this.a = vars[0]; this.b = vars[1]; //writeln("constructor called"); } } Foo foo = [300,300]; void main() { writeln(foo.a); } --- Compiles and works OK. I cant se

Re: std.net.curl get json_encode

2020-10-02 Thread Imperatorn via Digitalmars-d-learn
On Friday, 2 October 2020 at 21:12:09 UTC, Vino wrote: Hi All, Request your help, the below code is working but we need the output as a json array, in PHP we have json_encode(content), so how to do the same in D, the output is as below, as we need to store this output into database table w

Re: std.net.curl get json_encode

2020-10-02 Thread Imperatorn via Digitalmars-d-learn
On Friday, 2 October 2020 at 21:12:09 UTC, Vino wrote: Hi All, Request your help, the below code is working but we need the output as a json array, in PHP we have json_encode(content), so how to do the same in D, the output is as below, as we need to store this output into database table w

std.net.curl get json_encode

2020-10-02 Thread Vino via Digitalmars-d-learn
Hi All, Request your help, the below code is working but we need the output as a json array, in PHP we have json_encode(content), so how to do the same in D, the output is as below, as we need to store this output into database table which contains columns' (Id, Hostname, pool,email_id,use

Re: Can opDollar support a jagged 2D array?

2020-10-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On 10/2/20 1:24 PM, James Blachly wrote: On 10/2/20 9:32 AM, Steven Schveighoffer wrote: This seems like an oversight. But it's not impossible. Thank you Steve. Is there any chance that this mechanism will ever be revised? Presumably it would require a DIP. The problem is, how do you pass e

Re: Can opDollar support a jagged 2D array?

2020-10-02 Thread James Blachly via Digitalmars-d-learn
On 10/2/20 9:32 AM, Steven Schveighoffer wrote: This seems like an oversight. But it's not impossible. Thank you Steve. Is there any chance that this mechanism will ever be revised? Presumably it would require a DIP. Just curry the information to the receiver. opDollar doesn't have to retur

Re: Can opDollar support a jagged 2D array?

2020-10-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On 10/1/20 10:34 PM, James Blachly wrote: Suppose I have a data structure encoding sequence lengths: seq1: 0 1 2 ... N seq2: 0 1 2 3 4 ... M seq3: 0 1 ... P I would like to write opIndex and opDollar to support the notation obj[seq, x .. $] to retrieve sequences. However, given that opDollar

Re: vibe.d / experience / feedback

2020-10-02 Thread Denis Feklushkin via Digitalmars-d-learn
On Thursday, 1 October 2020 at 06:32:23 UTC, Robert M. Münch wrote: 4. Vide uses an own JSON type, not the standard one. We don't understand why, this just makes things much more complicated and one has to mess around with this. Because standard implementation worse? 5. One can't access t

Re: Trying to create a trivial 64 bit D Lang DLL on a Windows 10 machine and cant get past linking.

2020-10-02 Thread rikki cattermole via Digitalmars-d-learn
On 02/10/2020 9:33 PM, Imperatorn wrote: Did you create a D-partition just for D. Pro You can mount directories as a drive on Windows. https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/subst

Re: Trying to create a trivial 64 bit D Lang DLL on a Windows 10 machine and cant get past linking.

2020-10-02 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Friday, 2 October 2020 at 08:33:25 UTC, Imperatorn wrote: On Friday, 2 October 2020 at 08:07:33 UTC, Ferhat Kurtulmuş wrote: On Friday, 2 October 2020 at 07:34:03 UTC, WhatMeWorry wrote: On Thursday, 1 October 2020 at 21:56:46 UTC, Ferhat Kurtulmuş wrote: [...] Yes, I've been doing that.

Re: Trying to create a trivial 64 bit D Lang DLL on a Windows 10 machine and cant get past linking.

2020-10-02 Thread Imperatorn via Digitalmars-d-learn
On Friday, 2 October 2020 at 08:07:33 UTC, Ferhat Kurtulmuş wrote: On Friday, 2 October 2020 at 07:34:03 UTC, WhatMeWorry wrote: On Thursday, 1 October 2020 at 21:56:46 UTC, Ferhat Kurtulmuş wrote: On Thursday, 1 October 2020 at 21:35:42 UTC, WhatMeWorry wrote: [...] 1) try running your comm

Re: Trying to create a trivial 64 bit D Lang DLL on a Windows 10 machine and cant get past linking.

2020-10-02 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Friday, 2 October 2020 at 07:34:03 UTC, WhatMeWorry wrote: On Thursday, 1 October 2020 at 21:56:46 UTC, Ferhat Kurtulmuş wrote: On Thursday, 1 October 2020 at 21:35:42 UTC, WhatMeWorry wrote: On Thursday, 1 October 2020 at 20:28:58 UTC, kinke wrote: [...] Thanks all. I've gotten it to wo

Re: Trying to create a trivial 64 bit D Lang DLL on a Windows 10 machine and cant get past linking.

2020-10-02 Thread WhatMeWorry via Digitalmars-d-learn
On Thursday, 1 October 2020 at 21:56:46 UTC, Ferhat Kurtulmuş wrote: On Thursday, 1 October 2020 at 21:35:42 UTC, WhatMeWorry wrote: On Thursday, 1 October 2020 at 20:28:58 UTC, kinke wrote: [...] Thanks all. I've gotten it to work with: [...] [...] [...] total = 12 [...] 1) try