UFCS idea

Daniel Gibson metalcaedes at gmail.com
Wed Jun 8 17:31:44 PDT 2011


Am 09.06.2011 02:32, schrieb Timon Gehr:
> David Nadlinger wrote:
>> On 6/9/11 2:10 AM, Timon Gehr wrote:
>>> Also, don't we have non-nullable references in the language already?:
>>>
>>> int foo(ref int x){ // non nullable int reference!
>>
>> Nope, what's commonly meant by »non-nullable references« is, having some
>> reference type, the ability to declare some variable of that type that
>> can never be null, i.e.:
>>
>> ---
>> class Foo {}
>>
>> void main() {
>>    Foo@ foo; // An error, because foo would be null.
>> }
>> ---
>>
>> David
> 
> I understand that. I just think it would be a bit messy to have both @ references
> and ref for call by reference.
> 
> 
> Timon

I don't think it's for call by reference, it's to enforce that something
that already is a reference type (Objects, pointers) are not null.

Cheers,
- Daniel


More information about the Digitalmars-d mailing list