On Saturday, 16 August 2025 at 21:26:55 UTC, Brother Bill wrote:
On Saturday, 16 August 2025 at 15:44:45 UTC, Richard (Rikki) Andrew Cattermole wrote:
On 17/08/2025 3:44 AM, Brother Bill wrote:
On Saturday, 16 August 2025 at 15:30:43 UTC, H. S. Teoh wrote:
On Sat, Aug 16, 2025 at 03:24:55PM +0000, Brother Bill via Digitalmars-d-learn wrote: [...]
So a good D developer should not store an invalid pointer address into a pointer, with the single exception of storing a pointer address just past a slice or array.

Where does it say this in the spec?  Because this is wrong.

D arrays carry length with them; they do not rely on pointers pointing past the allocated memory region.


T

Source: Programming in D book, page 432, chapter 68.8
Quote: It is valid to point at the imaginary element one past the end of an array.

That is not the spec, the book is wrong.


Please provide link to the current spec?

Its irrelivent https://dlang.org/spec/type.html#pointers
Its defined on deference not on existence.

Its over in the gc that has any relivence:

https://dlang.org/spec/garbage.html#pointers_and_gc

Do not xor pointers with other values, like the xor pointer linked list trick used in C.

But this is just whake-a-mole docs, they are just describing how the current gc works without thoery or usecase clarity

Rikki will be wrong, an exclusive bounded would *have to* be defined by an off by 1 pointer, but no one does that not even me.
  • Re: Pointers - I... H. S. Teoh via Digitalmars-d-learn
  • Re: Pointers - I... Brother Bill via Digitalmars-d-learn
    • Re: Pointer... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
    • Re: Pointer... H. S. Teoh via Digitalmars-d-learn
    • Re: Pointer... Brother Bill via Digitalmars-d-learn
      • Re: Poi... H. S. Teoh via Digitalmars-d-learn
      • Re: Poi... Brother Bill via Digitalmars-d-learn
        • Re:... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
          • ... Brother Bill via Digitalmars-d-learn
            • ... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
            • ... monkyyy via Digitalmars-d-learn
              • ... Steven Schveighoffer via Digitalmars-d-learn
              • ... monkyyy via Digitalmars-d-learn
              • ... Steven Schveighoffer via Digitalmars-d-learn
              • ... monkyyy via Digitalmars-d-learn
          • ... 0xEAB via Digitalmars-d-learn
            • ... 0xEAB via Digitalmars-d-learn
            • ... Brother Bill via Digitalmars-d-learn
              • ... Monkyyy via Digitalmars-d-learn
              • ... Brother Bill via Digitalmars-d-learn
              • ... Monkyyy via Digitalmars-d-learn

Reply via email to