Re: Requiring weak purity for opAssign, postblit

2010-12-25 Thread Jonathan M Davis
On Saturday 25 December 2010 08:19:32 dsimcha wrote: > I've been thinking about adding purity to various parts of Phobos and one > thing that limits this in the case of containers is templated containers, > arrays, etc. that may be instantiated with a user-defined type. In theory, > even assigning

Re: Requiring weak purity for opAssign, postblit

2010-12-25 Thread Jonathan M Davis
On Saturday 25 December 2010 08:50:19 dsimcha wrote: > == Quote from bearophile (bearophileh...@lycos.com)'s article > > > dsimcha: > > > Does anyone see a problem with requiring opAssign and postblits to be > > > weakly pure to solve this problem? > > > > Time ago I have even suggested contracts

Re: Requiring weak purity for opAssign, postblit

2010-12-25 Thread spir
On Sat, 25 Dec 2010 18:46:17 + (UTC) Tomek Sowiński wrote: > dsimcha wrote: > > I've been thinking about adding purity to various parts of Phobos and > > one > > thing that limits this in the case of containers is templated > > containers, > > arrays, etc. that may be instantiated with a use

Re: Requiring weak purity for opAssign, postblit

2010-12-25 Thread bearophile
Tomek Sowiński: > 2. Functions ought to be weakly pure by default (please don't dismiss as > bikeshedding). It's the most common case by a large margin. This is right. I'd like functions to be pure on default and use an attribute like @outer() when whey aren't pure because they use mutables fro

Re: Requiring weak purity for opAssign, postblit

2010-12-25 Thread Tomek Sowiński
dsimcha wrote: > I've been thinking about adding purity to various parts of Phobos and > one > thing that limits this in the case of containers is templated > containers, > arrays, etc. that may be instantiated with a user-defined type. In > theory, > even assigning/copying a user-defined type co

Re: Requiring weak purity for opAssign, postblit

2010-12-25 Thread dsimcha
== Quote from bearophile (bearophileh...@lycos.com)'s article > dsimcha: > > Does anyone see a problem with requiring opAssign and postblits to be > > weakly pure to solve this problem? > Time ago I have even suggested contracts (pre/post/invariants) to be pure (as Design by Contract asks), or at l

Re: Requiring weak purity for opAssign, postblit

2010-12-25 Thread bearophile
dsimcha: > Does anyone see a problem with requiring opAssign and postblits to be > weakly pure to solve this problem? Time ago I have even suggested contracts (pre/post/invariants) to be pure (as Design by Contract asks), or at least class invariants to be const on default. Bye, bearophile

Requiring weak purity for opAssign, postblit

2010-12-25 Thread dsimcha
I've been thinking about adding purity to various parts of Phobos and one thing that limits this in the case of containers is templated containers, arrays, etc. that may be instantiated with a user-defined type. In theory, even assigning/copying a user-defined type could be impure. Does anyone se