On 5/14/14, 6:33 AM, Yuriy wrote:
On Wednesday, 14 May 2014 at 13:07:32 UTC, bearophile wrote:
I'd like to know why you think D classes should not have the monitor
on default (this means why you don't plan for a @no_pointer).
There are 4 reasons for that.
1. I'm thinking of monitors as members of Object class, so all other
classes have monitors just because they are inheriting it. So with my
proposal you would be able to add a monitor, but not remove it.
Agreed.
2. Mutex synchronization is pretty old-school approach, there's a lot of
cons to using it, and thus it should not be carved into the language core.
Agreed.
3. I can't imagine a project that has more than 10% of it's classes
being synchronized on, so this feature looks like more often unneeded
than needed.
Agreed.
4. I consider D a killemall language, that may be potentially used on
tiny AVRs and PICs, where polymorphism might be welcome, but an extra
pointer for each class instance may become a blocker. I know, thats
fantasy now, but i think it's crucial to keep this concept of D.
Agreed at least with the "killing the mall" part :o).
Andrei