Thanks very much Peter. I'm going to repeat the first part of the question
although I think your answer partially addressed it.
My class MPFR is a reference type which, I think, explains why `print
(({MPFR}).has_default)' returns "False" - please correct me if this is
wrong. In my project settings I have Are types attached by default? set to
True and Void safety set to Complete void safety. I thought that this would
cause ({MPFR}).has_default to return true as class MPFR does have
`default_create' as a creation routine.
Regards
Chris Saunders
From: Peter Gummer
Sent: Friday, July 17, 2009 9:14 PM
To:
[hidden email]
Subject: Re: [eiffel_software] Two questions
On 18/07/2009, at 10:35, Chris Saunders wrote:
> My other question is about this query from ANY:
>
> frozen default: detachable like Current
>
> -- Default value of object's type
> do
> end
>
> As this query is frozen I am wondering about is purpose.
It takes advantage of one of the great things about Eiffel, namely,
that local variables are initialised to the type's default value. If
it's a reference type, then the default value is Void; if it's an
INTEGER, then the default value is 0; if it's a BOOLEAN, then the
default value is False; and so on.
So this function simply returns the default value of the current
object's type.
- Peter Gummer