Re: why remove octal literal support?

2023-11-05 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, November 5, 2023 9:59:22 PM MST d007 via Digitalmars-d-learn wrote: > On Friday, 3 November 2023 at 15:34:37 UTC, Steven Schveighoffer > > wrote: > > On Friday, 3 November 2023 at 15:07:41 UTC, d007 wrote: > >> dlang is know for compile speed, but in reality d project > >> compile slow

Re: How should class objects created in betterC be destroyed

2023-11-05 Thread zoe via Digitalmars-d-learn
On Monday, 6 November 2023 at 05:52:18 UTC, Imperatorn wrote: On Monday, 6 November 2023 at 05:30:02 UTC, zoe wrote: I customized object.d in -betterc mode and created NEW templates, with modules I can seemingly create classes without extern(C++) mode, and type conversions in function calls see

Re: How should class objects created in betterC be destroyed

2023-11-05 Thread zoe via Digitalmars-d-learn
On Monday, 6 November 2023 at 05:52:18 UTC, Imperatorn wrote: On Monday, 6 November 2023 at 05:30:02 UTC, zoe wrote: I customized object.d in -betterc mode and created NEW templates, with modules I can seemingly create classes without extern(C++) mode, and type conversions in function calls see

Re: How should class objects created in betterC be destroyed

2023-11-05 Thread Imperatorn via Digitalmars-d-learn
On Monday, 6 November 2023 at 05:30:02 UTC, zoe wrote: I customized object.d in -betterc mode and created NEW templates, with modules I can seemingly create classes without extern(C++) mode, and type conversions in function calls seem to work fine. But when destroy doesn't find a way to call th

How should class objects created in betterC be destroyed

2023-11-05 Thread zoe via Digitalmars-d-learn
I customized object.d in -betterc mode and created NEW templates, with modules I can seemingly create classes without extern(C++) mode, and type conversions in function calls seem to work fine. But when destroy doesn't find a way to call the __xtdor() method of the corresponding subclass, is th

Re: Is a shorter statement possible in this case?

2023-11-05 Thread user1234 via Digitalmars-d-learn
On Sunday, 5 November 2023 at 18:36:40 UTC, Ctn-Dev wrote: I wrote this earlier: [...] if runs when both "One" and "Two" are in the given array as intended, but its conditional statement looks verbose. Is there a more concise way of getting the same result? Yes, assuming you accept to drop

Re: why remove octal literal support?

2023-11-05 Thread d007 via Digitalmars-d-learn
On Friday, 3 November 2023 at 15:34:37 UTC, Steven Schveighoffer wrote: On Friday, 3 November 2023 at 15:07:41 UTC, d007 wrote: dlang is know for compile speed, but in reality d project compile slow because so much ctfe and tempalte. Why bring more ctfe call by remmove octal literal ? octa

Re: Is a shorter statement possible in this case?

2023-11-05 Thread Andrey Zherikov via Digitalmars-d-learn
On Sunday, 5 November 2023 at 18:36:40 UTC, Ctn-Dev wrote: Is there a more concise way of getting the same result? Try this: ```d switch(range.map!(_ => (_== "Two" ? 2 : _=="One" ? 1 : 0)).fold!((a,b) => a | b)(0)) { case 3: writeln("both"); break; case 2: writein("only two"); break; case 1:

Re: What are the best available D (not C) File input/output options?

2023-11-05 Thread confuzzled via Digitalmars-d-learn
On 11/3/23 2:30 AM, Steven Schveighoffer wrote: On Thursday, 2 November 2023 at 15:46:23 UTC, confuzzled wrote: You should use a buffering library like iopipe to write properly here (it handles the encoding of text for you). Thanks Steve, I will try that.

Re: Dlang installer with VSCode broken

2023-11-05 Thread Steven Schveighoffer via Digitalmars-d-learn
On Sunday, 5 November 2023 at 22:28:29 UTC, Daniel Donnelly, Jr. wrote: This is on my friend's machine, who I am teaching D. What can be done? Can you describe what you did? Also, might be helpful to file an issue on the code-d github repository itself: https://github.com/Pure-D/code-d

Re: What are the best available D (not C) File input/output options?

2023-11-05 Thread confuzzled via Digitalmars-d-learn
Good morning, First, thanks to you, Steve, and Julian for responding to my inquiry. On 11/3/23 4:59 AM, Sergey wrote: On Thursday, 2 November 2023 at 15:46:23 UTC, confuzzled wrote: I've ported a small script from C to D. The original C version takes roughly 6.5 minutes to parse a 12G file w

Dlang installer with VSCode broken

2023-11-05 Thread Daniel via Digitalmars-d-learn
ERRORS: -- \2023-11-05 22:21:07.370 [warning] Via 'product.json#extensionEnabledApiProposals' extension 'ms-dotnettools.dotnet-interactive-vscode' wants API proposal 'languageConfigurationAutoClosingPairs' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (che

Re: DUB: Sometimes generates .di file and sometimes do not.

2023-11-05 Thread BoQsc via Digitalmars-d-learn
Configuration to generate only `.di` (D Header file) ``` name "dheaders" description "generates .di header file for a static library." authors "public domain" copyright "Public Domain. No rights reserved." license "public domain" configuration "staticLibrary" { dflags "-Hf=$PACKAGE_DIR/b

Is a shorter statement possible in this case?

2023-11-05 Thread Ctn-Dev via Digitalmars-d-learn
I wrote this earlier: ``` import std.stdio; import std.algorithm.searching; string[] numeric_traits_1 = []; string[] numeric_traits_2 = ["Two"]; string[] numeric_traits_3 = ["One"]; string[] numeric_traits_4 = ["One", "Two"]; void main() { void numeric_traits_contains(string[] numeric) {

Re: DUB: Sometimes generates .di file and sometimes do not.

2023-11-05 Thread BoQsc via Digitalmars-d-learn
**Conclusive observation:** This can be resolved by informing `dub` of `extraDependencyFiles` to rebuild itself. `library.di` non-existance simply does not trigger rebuild of the package and instead only `library.lib` is being copied from the `cache` folder into `build` folder. Leaving `library

Re: DUB: Sometimes generates .di file and sometimes do not.

2023-11-05 Thread BoQsc via Digitalmars-d-learn
On Sunday, 5 November 2023 at 10:54:35 UTC, Imperatorn wrote: On Sunday, 5 November 2023 at 10:53:33 UTC, BoQsc wrote: I would like to know how to solve this problem with `dub`. **dub.sdl** ``` name "dheaders" description "generates .di header file for a static library." authors "public domain

Re: DUB: Sometimes generates .di file and sometimes do not.

2023-11-05 Thread Imperatorn via Digitalmars-d-learn
On Sunday, 5 November 2023 at 10:53:33 UTC, BoQsc wrote: I would like to know how to solve this problem with `dub`. **dub.sdl** ``` name "dheaders" description "generates .di header file for a static library." authors "public domain" copyright "Public Domain. No rights reserved." license "publi

DUB: Sometimes generates .di file and sometimes do not.

2023-11-05 Thread BoQsc via Digitalmars-d-learn
I would like to know how to solve this problem with `dub`. **dub.sdl** ``` name "dheaders" description "generates .di header file for a static library." authors "public domain" copyright "Public Domain. No rights reserved." license "public domain" configuration "staticLibrary" { dflags