[fpc-pascal] Primitive Record Wrappers
Mazola Winstrol
mazofeifer at gmail.com
Wed Feb 17 18:40:52 CET 2016
Hello list,
In some situations, would be very interesting to determine whether the
value of a primitive variable is initialized or not. For example, fields in
database records can contain null values. By implementing an ORM, it would
be interesting to represent these null values in the properties of objects.
Java has the so called Primitives Class Wrappers, where each primitive type
(int, boolean ...) has a corresponding wrapper class (Integer, Boolean ...). By
using class wrappers you can represent null values in primitive types
through null class instances references.
Using class wrappers in FPC is not feasible due to memory management issues
(the programmer needs to worry about the lifetime of the instances and free
the instances manually).
Perhaps, a solution in FPC would be using primitive record wrappers with
custom records operators.
What do you think about it? Is there any other solution?
Regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160217/4d91e54f/attachment.html>
More information about the fpc-pascal
mailing list