Reply to Nick,

It's been established in the recent epic-discussions on properties
that one of the biggest uses for properties is to implement publically
read-only (but privately-writable) fields. That got me thinking, why
not actually have real publically read-only fields instead of merely
emulating them with properties? They are, after all, a fairly common
idiom.

// *Not* an actual syntax proposal, but just to get the idea across:

private @publicread int foo;

// The class sees it as "int", but everything else sees it as
"const(int)" // ...or something like that...


how about this for a syntax:

private int i;
alias public const i;


Reply via email to