Bug 24890 – spec/arrays.dd should mention comparison and warn about dangling .ptr
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dlang.org
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2024-11-29T17:59:50Z
Last change time
2024-11-30T23:20:28Z
Keywords
pull
Assigned to
No Owner
Creator
Nick Treleaven
Comments
Comment #0 by nick — 2024-11-29T17:59:50Z
Although array comparison is defined in expression.dd, arrays.dd should discuss the difference between equality and `is` identity.
arrays.dd should also make it clear why `.ptr` is not @safe.
PR incoming.
Comment #1 by dlang-bot — 2024-11-29T18:16:23Z
@ntrel created dlang/dlang.org pull request #3930 "Fix Bugzilla 24890 - spec/arrays.dd should mention comparison and war…" fixing this issue:
- Fix Bugzilla 24890 - spec/arrays.dd should mention comparison and warn about dangling .ptr
Add comparison section.
Introduce .length earlier in the docs.
Define `a == b` and `a is b` for arrays.
Add link to array RelExpression.
Tweak assignment example so comments refer to actual elements.
Make *Array Length* a sub-heading of slicing.
Add relative links for properties.
Document that static array .length is known at compile-time.
Add .ptr section.
Document that .ptr can be dangling so it's not `@safe`.
Mention `TypeInfo.initializer`.
https://github.com/dlang/dlang.org/pull/3930
Comment #2 by dlang-bot — 2024-11-30T23:20:28Z
dlang/dlang.org pull request #3930 "Fix Bugzilla 24890 - spec/arrays.dd should mention comparison and war…" was merged into master:
- 56717b3ca30d53fec47d6f10e8b0ee0b958e8014 by Nick Treleaven:
Fix Bugzilla 24890 - spec/arrays.dd should mention comparison and warn about dangling .ptr
Add comparison section.
Introduce .length earlier in the docs.
Define `a == b` and `a is b` for arrays.
Add link to array RelExpression.
Tweak assignment example so comments refer to actual elements.
Make *Array Length* a sub-heading of slicing.
Add relative links for properties.
Document that static array .length is known at compile-time.
Add .ptr section.
Document that .ptr can be dangling so it's not `@safe`.
Mention `TypeInfo.initializer`.
https://github.com/dlang/dlang.org/pull/3930