www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: Spec#, nullables and more

reply bearophile <bearophileHUGS lycos.com> writes:
Denis Koroskin:

 Is anyone FORCING you to use non-nullable references?
 What's the big deal?

If non-nullables are introduced in D3, then Phobos will start to use them. So probably you can't avoid using some of them. Bye, bearophile
Nov 05 2010
parent reply =?ISO-8859-1?Q?Pelle_M=E5nsson?= <pelle.mansson gmail.com> writes:
On 11/05/2010 08:30 PM, bearophile wrote:
 Denis Koroskin:

 Is anyone FORCING you to use non-nullable references?
 What's the big deal?

If non-nullables are introduced in D3, then Phobos will start to use them. So probably you can't avoid using some of them. Bye, bearophile

If we're still following the 'calls to phobos considered external input'-thing, the nulls still have to be checked. So, no loss there, performance wise.
Nov 05 2010
parent =?UTF-8?B?IkrDqXLDtG1lIE0uIEJlcmdlciI=?= <jeberger free.fr> writes:
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Pelle M=C3=A5nsson wrote:
 On 11/05/2010 08:30 PM, bearophile wrote:
 Denis Koroskin:

 Is anyone FORCING you to use non-nullable references?
 What's the big deal?

If non-nullables are introduced in D3, then Phobos will start to use them. So probably you can't avoid using some of them. Bye, bearophile

If we're still following the 'calls to phobos considered external input'-thing, the nulls still have to be checked. So, no loss there, performance wise.

Actually, you have a *gain* performance-wise since Phobos can drop the checks and use a non-nullable type, which means that there will be no check if the compiler can determine that you are passing a non-null pointer statically... Jerome --=20 mailto:jeberger free.fr http://jeberger.free.fr Jabber: jeberger jabber.fr
Nov 06 2010