Date: Sat, 30 Nov 2019 20:15:00 +0000
Nevin Liber via Std-Proposals:
> Should all functions which have preconditions on calling them be named
> unsafe_***? I would not want to call unsafe_dereference(ptr) instead of
> *ptr each and every time I needed to dereference it (for example). I'm
> generally against verbosity for common cases.
Sure, a better solution would be Rust unsafe blocks. So you would write
dereference like this:
unsafe
{
auto value = *ptr;
}
But that requires going through entire language to split it into safe
and unsafe parts.
> Should all functions which have preconditions on calling them be named
> unsafe_***? I would not want to call unsafe_dereference(ptr) instead of
> *ptr each and every time I needed to dereference it (for example). I'm
> generally against verbosity for common cases.
Sure, a better solution would be Rust unsafe blocks. So you would write
dereference like this:
unsafe
{
auto value = *ptr;
}
But that requires going through entire language to split it into safe
and unsafe parts.
Received on 2019-11-30 14:17:49