Re: Code duplication where you wish to have a routine called with either immutable or mutable arguments

2023-05-31 Thread Dom DiSc via Digitalmars-d-learn
On Wednesday, 31 May 2023 at 03:29:33 UTC, Cecil Ward wrote: I have to admit that I don’t really understand immutable. I have an idea that it could mean that an object has an address in ROM, so its value will never change. Maybe const doesn’t give you such a strong guarantee, disallows ‘you’ fr

Re: static immutable that has no initialiser - should this raise an error?

2023-05-31 Thread Dom DiSc via Digitalmars-d-learn
On Tuesday, 30 May 2023 at 04:11:00 UTC, Cecil Ward wrote: static immutable T foo; T bar() { return foo; } Should we get an error from the D compiler here as the initialiser has been forgotten? What do you think ? No. There are no un-initialized values in D. It gets its default value,

Re: Code duplication where you wish to have a routine called with either immutable or mutable arguments

2023-05-31 Thread Cecil Ward via Digitalmars-d-learn
On Wednesday, 31 May 2023 at 09:14:49 UTC, Dom DiSc wrote: On Wednesday, 31 May 2023 at 03:29:33 UTC, Cecil Ward wrote: I have to admit that I don’t really understand immutable. I have an idea that it could mean that an object has an address in ROM, so its value will never change. Maybe const d

Indenting standards religions K&R, whitesmiths etc

2023-05-31 Thread Cecil Ward via Digitalmars-d-learn
I wanted to ask how some of the leaders of our group feel about D indentation standards. `i realise that this causes some religious fervour in C. I could be in trouble here because in all my years at work, we never used K & R ‘one true brace style’ indenting, with the house style I’m used to be

Re: Indenting standards religions K&R, whitesmiths etc

2023-05-31 Thread matheus via Digitalmars-d-learn
On Wednesday, 31 May 2023 at 16:24:38 UTC, Cecil Ward wrote: ... So my question: would I get lynched for the following? (below) ... I don't know nothing about all this but looking your example code, I write and I'd prefer to read something like this (Editing your own code): pure nothrow et

How does D’s ‘import’ work?

2023-05-31 Thread Cecil Ward via Digitalmars-d-learn
Is there an explanation of how D’s ‘import’ works somewhere? I’m trying to understand the comparison with the inclusion of .h files, similarities if any and differences with the process.

Re: How does D’s ‘import’ work?

2023-05-31 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, May 31, 2023 at 06:43:52PM +, Cecil Ward via Digitalmars-d-learn wrote: > Is there an explanation of how D’s ‘import’ works somewhere? I’m > trying to understand the comparison with the inclusion of .h files, > similarities if any and differences with the process. Unlike C's #include,

Re: Indenting standards religions K&R, whitesmiths etc

2023-05-31 Thread thinkunix via Digitalmars-d-learn
matheus via Digitalmars-d-learn wrote: On Wednesday, 31 May 2023 at 16:24:38 UTC, Cecil Ward wrote: ... So my question: would I get lynched for the following? (below) ... I don't know nothing about all this but looking your example code, I write and I'd prefer to read something like this (Edi

Re: Indenting standards religions K&R, whitesmiths etc

2023-05-31 Thread Ernesto Castellotti via Digitalmars-d-learn
On Wednesday, 31 May 2023 at 16:24:38 UTC, Cecil Ward wrote: I wanted to ask how some of the leaders of our group feel about D indentation standards. `i realise that this causes some religious fervour in C. I could be in trouble here because in all my years at work, we never used K & R ‘one tru

Re: Indenting standards religions K&R, whitesmiths etc

2023-05-31 Thread Cecil Ward via Digitalmars-d-learn
On Wednesday, 31 May 2023 at 22:06:50 UTC, Ernesto Castellotti wrote: On Wednesday, 31 May 2023 at 16:24:38 UTC, Cecil Ward wrote: I wanted to ask how some of the leaders of our group feel about D indentation standards. `i realise that this causes some religious fervour in C. I could be in trou

Re: How does D’s ‘import’ work?

2023-05-31 Thread Cecil Ward via Digitalmars-d-learn
On Wednesday, 31 May 2023 at 18:56:02 UTC, H. S. Teoh wrote: On Wed, May 31, 2023 at 06:43:52PM +, Cecil Ward via Digitalmars-d-learn wrote: Is there an explanation of how D’s ‘import’ works somewhere? I’m trying to understand the comparison with the inclusion of .h files, similarities if a

Re: How does D’s ‘import’ work?

2023-05-31 Thread Cecil Ward via Digitalmars-d-learn
On Wednesday, 31 May 2023 at 18:43:52 UTC, Cecil Ward wrote: Is there an explanation of how D’s ‘import’ works somewhere? I’m trying to understand the comparison with the inclusion of .h files, similarities if any and differences with the process. I have another question if I may, what do we d

Re: Indenting standards religions K&R, whitesmiths etc

2023-05-31 Thread Ernesto Castellotti via Digitalmars-d-learn
On Thursday, 1 June 2023 at 03:34:33 UTC, Cecil Ward wrote: On Wednesday, 31 May 2023 at 22:06:50 UTC, Ernesto Castellotti wrote: On Wednesday, 31 May 2023 at 16:24:38 UTC, Cecil Ward wrote: [...] Excuse me but for me the only style I like is the K&R. I can accept Allman but the rest is here