First Draft: Static Single Assignment

Walter Bright newshound2 at digitalmars.com
Fri Dec 5 01:18:44 UTC 2025


On 12/2/2025 3:04 PM, Paul Backus wrote:
> However, I do not think the best solution to that problem is to implement it in 
> this strange, halfway-in-between state, where it's technically a storage class 
> but sometimes *behaves* like a type qualifier.

It does what it says on the cereal box it does - you cannot change the value of 
a final declaration once it is initialized.

The complications come from taking the address of a final variable. I doubt this 
will be a common usage pattern. I suppose we could delete that behavior, but I 
want to see first if we can use it productively.

> This is the exact kind of 
> confusing dessert topping/floor wax duality that you (rightly) criticize in 
> C++'s reference types.

I recall the dessert topping / floor wax was about a struct could be both a 
value type and a reference type.

> If we are not willing to commit to making final a fully-fledged type qualifier, 
> then I think we would be better off not including it in the language at all. If 
> it's not worth doing right, it's not worth doing.

We can disagree on what is 'right' !!


More information about the dip.development mailing list