Re: Const-correctness and uniqueness. Again.

2015-02-11 Thread deadalnix via Digitalmars-d
On Wednesday, 11 February 2015 at 18:37:42 UTC, deadalnix wrote: On Wednesday, 11 February 2015 at 13:54:12 UTC, Dicebot wrote: On Monday, 9 February 2015 at 23:40:31 UTC, deadalnix wrote: Someone is starting to see where I'm getting at when I'm pushing for owned... I don't think this specifi

Re: Const-correctness and uniqueness. Again.

2015-02-11 Thread deadalnix via Digitalmars-d
On Wednesday, 11 February 2015 at 13:54:12 UTC, Dicebot wrote: On Monday, 9 February 2015 at 23:40:31 UTC, deadalnix wrote: Someone is starting to see where I'm getting at when I'm pushing for owned... I don't think this specific case is a good justification for your proposal - it is simple e

Re: Const-correctness and uniqueness. Again.

2015-02-11 Thread Dicebot via Digitalmars-d
On Monday, 9 February 2015 at 23:40:31 UTC, deadalnix wrote: Someone is starting to see where I'm getting at when I'm pushing for owned... I don't think this specific case is a good justification for your proposal - it is simple enough to accept a library based solution. We need more accumula

Re: Const-correctness and uniqueness. Again.

2015-02-09 Thread deadalnix via Digitalmars-d
On Monday, 9 February 2015 at 10:56:31 UTC, Dicebot wrote: Doing a lot of porting from D1 to D2 recently I have realized that we still don't have any idiomatic way to express function result types that can be both mutable and immutable. Consider this trivial snippet: ```D import std.array : j

Re: Const-correctness and uniqueness. Again.

2015-02-09 Thread Jakob Ovrum via Digitalmars-d
On Monday, 9 February 2015 at 11:38:23 UTC, Jakob Ovrum wrote: On Monday, 9 February 2015 at 11:37:23 UTC, Jakob Ovrum wrote: std.array.join is strongly pure (with appropriate template arguments), so its return value is implicitly convertible to immutable. Err, implicitly convertible to *muta

Re: Const-correctness and uniqueness. Again.

2015-02-09 Thread Kenji Hara via Digitalmars-d
2015-02-10 0:15 GMT+09:00 via Digitalmars-d : > On Monday, 9 February 2015 at 13:19:24 UTC, Tobias Pankrath wrote: > >> On Monday, 9 February 2015 at 12:39:06 UTC, Marc Schütz wrote: >> >>> It does? Not according to my tests. And it would be bad if it did, >>> because the returned immutable value

Re: Const-correctness and uniqueness. Again.

2015-02-09 Thread via Digitalmars-d
On Monday, 9 February 2015 at 13:19:24 UTC, Tobias Pankrath wrote: On Monday, 9 February 2015 at 12:39:06 UTC, Marc Schütz wrote: On Monday, 9 February 2015 at 11:38:23 UTC, Jakob Ovrum wrote: On Monday, 9 February 2015 at 11:37:23 UTC, Jakob Ovrum wrote: std.array.join is strongly pure (with a

Re: Const-correctness and uniqueness. Again.

2015-02-09 Thread Tobias Pankrath via Digitalmars-d
On Monday, 9 February 2015 at 12:39:06 UTC, Marc Schütz wrote: On Monday, 9 February 2015 at 11:38:23 UTC, Jakob Ovrum wrote: On Monday, 9 February 2015 at 11:37:23 UTC, Jakob Ovrum wrote: std.array.join is strongly pure (with appropriate template arguments), so its return value is implicitly c

Re: Const-correctness and uniqueness. Again.

2015-02-09 Thread via Digitalmars-d
On Monday, 9 February 2015 at 11:38:23 UTC, Jakob Ovrum wrote: On Monday, 9 February 2015 at 11:37:23 UTC, Jakob Ovrum wrote: std.array.join is strongly pure (with appropriate template arguments), so its return value is implicitly convertible to immutable. Err, implicitly convertible to *muta

Re: Const-correctness and uniqueness. Again.

2015-02-09 Thread Dicebot via Digitalmars-d
On Monday, 9 February 2015 at 11:37:23 UTC, Jakob Ovrum wrote: std.array.join is strongly pure (with appropriate template arguments), so its return value is implicitly convertible to immutable. Ahha, I have missed that part. Thanks!

Re: Const-correctness and uniqueness. Again.

2015-02-09 Thread Jakob Ovrum via Digitalmars-d
On Monday, 9 February 2015 at 10:56:31 UTC, Dicebot wrote: Consider this trivial snippet: ```D import std.array : join; void main() { auto s = join([ "aaa", "bbb", "ccc" ]); pragma(msg, typeof(s)); } ``` It outputs "string" which stands for immutable buffer. The following wor

Re: Const-correctness and uniqueness. Again.

2015-02-09 Thread Jakob Ovrum via Digitalmars-d
On Monday, 9 February 2015 at 11:37:23 UTC, Jakob Ovrum wrote: std.array.join is strongly pure (with appropriate template arguments), so its return value is implicitly convertible to immutable. Err, implicitly convertible to *mutable*. It goes both ways.

Const-correctness and uniqueness. Again.

2015-02-09 Thread Dicebot via Digitalmars-d
Doing a lot of porting from D1 to D2 recently I have realized that we still don't have any idiomatic way to express function result types that can be both mutable and immutable. Consider this trivial snippet: ```D import std.array : join; void main() { auto s = join([ "aaa", "bbb", "c