Call site 'ref'

Alex Rønne Petersen xtzgzorex at gmail.com
Sun Jan 15 06:03:58 PST 2012


On 15-01-2012 15:12, Peter Alexander wrote:
> On 15/01/12 1:56 PM, Johnatan Frakes wrote:
>> You are, lazy, sir, and your programming license should be revoked.
>>
>> By that logic we should dull all knives because somebody might get hurt.
>>
>> My 2c.
>
> This has nothing to do with laziness. It's an error-detection mechanism,
> just like many other language features (e.g. override, const, immutable,
> shared, ...).
>
> I agree with requiring ref at the call site in principle, although it
> would be too much of a breaking change to introduce now. Perhaps allow
> it, and issue a warning if not used?

That sounds reasonable to me. Maybe make it a compiler option like 
-property though? -callsiteref? Something like that.

--
- Alex


More information about the Digitalmars-d mailing list