[Lazarus] exception handling in constructor

Flávio Etrusco flavio.etrusco at gmail.com
Sat Mar 2 20:28:01 CET 2013


On Sat, Mar 2, 2013 at 7:51 AM, Michael Van Canneyt
<michael at freepascal.org> wrote:
>
>
> On Sat, 2 Mar 2013, Howard Page-Clark wrote:
>
>> On 02/03/13 5:45, Flávio Etrusco wrote:
>>>
>>> On Fri, Mar 1, 2013 at 11:49 PM, Xiangrong Fang <xrfang at gmail.com> wrote:
>>>>
(...)
>
> Also, setting Self to nil is nonsense.
>
> If you do FreeAndNil(Self) instead, it will work.
>
> But I would seriously warn against doing this kind of thing.


Wow, this is unexpected. I always thougth that by definition a
constructor would never return nil - so Self was a "by-value"
parameter, even inside a constructor.
Is this by design?
I never saw the point of allowing assign to Self,...

-Flávio




More information about the Lazarus mailing list