User talk:Chronos

From Lazarus wiki
Revision as of 09:00, 13 November 2018 by Chronos (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Hmm, the fact tha a pointer can be nil does not mean that a pointer is nullable. A pointer points to a memory adress. Setting a pointer to nil, simply points it to memory adress 0. --Bart (talk) 18:44, 12 November 2018 (CET)

This is matter of difference between a concept and an implementation. Pointer type is nullable because it can be set to have "no value" which is represented with nil in Delphi. Nil is implemented like const nil = Pointer(0) which is simply zero address. But how would you implement it differently to be the most efficient for computation? And also nil is the same concept as null in C# or NULL in C/C++. And null is used in C# for nullable types. In Delphi there is also Assigned function which can be used for testing variable for nil value, but it would be complicated to implement same function for generic Nullable record.--Chronos (talk) 09:00, 13 November 2018 (CET)