> On Apr 12, 2019, at 3:52 PM, Jonas Maebe <jo...@freepascal.org> wrote:
> 
> Normally, if it can't accept nil it should be var-parameter, and if it can 
> then it should be a pointer.
> 
> This becomes less clear if a parameter type is already an implicit pointer 
> type (like a class or interface), but there are fewer case of that kind.

I actually suggest this solely for the use of pointer types in order to:

1) prevent nil pointer dereferencing (do I need to check for nil on this 
parameter/return value or is it safe to access?)
2) self documenting code (can this parameter accept nil?)

Using var and pointers to pointers are possible workarounds but they’re not 
really expressing what we mean so it seemed logical to add this to the list of 
parameter modifiers already existing.

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to