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

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

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

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 digitalmars-d@puremagic.com: 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

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

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.

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 works as

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!

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, ccc

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

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 :

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

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