On 3/17/2011 5:02 PM, Andrei Alexandrescu wrote:
> [...]


I don't disagree with anything you wrote. But I am suggesting that one liners should have a high utility to be justifiably included in Phobos.

---------------------------------

You mentioned wondering where we should draw the line in using asserts to check function inputs as opposed to using enforce. I suggest that line should be when a shared library/dll boundary is crossed. Statically linked libs should use assert.

The reason is straightforward - a shared library/dll cannot know in advance what will be connected to it, so it should treat data coming in from an external source as untrusted input. A statically linked library, on the other hand, is inextricably bound to a specific caller and is debugged/tested as a whole.

This raises the spectre about what to do with Phobos if Phobos is built as a 
dll.

Reply via email to