fieldPostBlit - what is wrong with this and workarounds

Maxim Fomin maxim at maxim-fomin.ru
Thu Oct 31 11:00:58 PDT 2013


On Thursday, 31 October 2013 at 17:22:07 UTC, Daniel Davidson 
wrote:
>
> I'm think you may be correct... but what specifically is 
> incorrect about the language?
> When I see __fieldPostBlit I get the feeling it is more an 
> implementation issue than the language.

__postblit also looks like implementation detail but it is same 
problem. Field postblit means that aggregate has some members 
which have postblits so they should be called. This is same 
problem which blows in higher level.

> If as you suggest, D language is fundamentally broken - is it 
> possible we can just get a plan for fixing it? To me this seems 
> like a huge design hole and I come back to the threads with 
> questions again and again and I really don't know how others 
> manage the use of const/immutable.

This is probable tenth thread about const postblits which I do 
remember for all my (only) 2 years in D. D2 (version currently in 
use) dates back to 2004 AFAIK and Andrei (helping to design the 
language) is in D since 2006, also AFAIK. Draw your own 
conclusions.

> I've already given up on immutable. If I have to strip const as 
> well then that is a huge pain and unfortunate since the concept 
> seems sound and well argued in TDPL. Trying to mess with 
> mutable/const/immutable on mostly working code is like playing 
> whack a mole.

One can do: 1) revise the design to challange whether consts are 
really necessary 2a) use workarounds like const pointer 2b) use 
cast to break const or another tricks (explicit casts are better 
because holes in type system may be fixed in some point in the 
feature)


More information about the Digitalmars-d-learn mailing list