[bitc-dev] Are type classes just abstract, generic classes?
Michal Suchanek
hramrach at centrum.cz
Thu Mar 25 07:20:01 PDT 2010
On 25 March 2010 14:42, Sandro Magi <naasking at higherlogics.com> wrote:
> Why bother with accessors at all? IMO, you're better off just specifying
> usage constraints on fields. All you need are mutability and visibility
> constraints. Take C#'s property accessors:
>
> public Foo Bar { get; private set; }
>
> You can just as easily take this as a usage specification for a Bar
> field with no loss of generality, and no method overhead.
>
Because if you manually write accessors you can include some magic in
them or write accessors for non-existent fields to compute/translate
them from existing fields. Once you define that something is a field
rather than a method you lose all of this.
Thanks
Michal
More information about the bitc-dev
mailing list