digitalmars.D.learn - On Variable References
- "Per =?UTF-8?B?Tm9yZGzDtnci?= <per.nordlow gmail.com> (9/9) Jan 21 2015 Why doesn't D allow declarations such as
- "Per =?UTF-8?B?Tm9yZGzDtnci?= <per.nordlow gmail.com> (4/6) Jan 21 2015 Correction: I, of course mean,
- Meta (4/11) Jan 21 2015 Walter is strongly against adding references a la C++ to D, as he
- =?UTF-8?B?Ik5vcmRsw7Z3Ig==?= (3/6) Jan 21 2015 It would be interesting to read about how Walter thinks here :)
- weaselcat (5/19) Jan 21 2015 Artificial constraints like this and no default constructor
- "Marc =?UTF-8?B?U2Now7x0eiI=?= <schuetzm gmx.net> (3/17) Jan 22 2015 In DIP69, he himself proposed `ref` locals. However, that's not
- Meta (4/22) Jan 22 2015 Hmm, it seems that he did. If D were to allow creating ref
Why doesn't D allow declarations such as int x; auto ref xr; ? What is so fundamentally bad about this compared to foreach variables and function arguments passed by reference? Will Walters latest commits regarding http://wiki.dlang.org/DIP25 change this matter?
Jan 21 2015
On Wednesday, 21 January 2015 at 08:22:44 UTC, Per Nordlöw wrote:int x; auto ref xr;Correction: I, of course mean, int x = 42; auto ref xr = x;
Jan 21 2015
On Wednesday, 21 January 2015 at 08:23:44 UTC, Per Nordlöw wrote:On Wednesday, 21 January 2015 at 08:22:44 UTC, Per Nordlöw wrote:Walter is strongly against adding references a la C++ to D, as he believes they are too complicated and bug prone. He's made several posts on this, but I can't find them now.int x; auto ref xr;Correction: I, of course mean, int x = 42; auto ref xr = x;
Jan 21 2015
On Wednesday, 21 January 2015 at 17:14:29 UTC, Meta wrote:Walter is strongly against adding references a la C++ to D, as he believes they are too complicated and bug prone. He's made several posts on this, but I can't find them now.It would be interesting to read about how Walter thinks here :) Thanks anyway.
Jan 21 2015
On Wednesday, 21 January 2015 at 17:14:29 UTC, Meta wrote:On Wednesday, 21 January 2015 at 08:23:44 UTC, Per Nordlöw wrote:Artificial constraints like this and no default constructor implementations for structs makes D annoying to use for programming that relies heavily on deterministic resource management tbh.On Wednesday, 21 January 2015 at 08:22:44 UTC, Per Nordlöw wrote:Walter is strongly against adding references a la C++ to D, as he believes they are too complicated and bug prone. He's made several posts on this, but I can't find them now.int x; auto ref xr;Correction: I, of course mean, int x = 42; auto ref xr = x;
Jan 21 2015
On Wednesday, 21 January 2015 at 17:14:29 UTC, Meta wrote:On Wednesday, 21 January 2015 at 08:23:44 UTC, Per Nordlöw wrote:In DIP69, he himself proposed `ref` locals. However, that's not the same as "references a la C++".On Wednesday, 21 January 2015 at 08:22:44 UTC, Per Nordlöw wrote:Walter is strongly against adding references a la C++ to D, as he believes they are too complicated and bug prone. He's made several posts on this, but I can't find them now.int x; auto ref xr;Correction: I, of course mean, int x = 42; auto ref xr = x;
Jan 22 2015
On Thursday, 22 January 2015 at 14:52:26 UTC, Marc Schütz wrote:On Wednesday, 21 January 2015 at 17:14:29 UTC, Meta wrote:Hmm, it seems that he did. If D were to allow creating ref variables, wouldn't D ref be more or less like in C++, then? Aside from the weirder things like T&& and such.On Wednesday, 21 January 2015 at 08:23:44 UTC, Per Nordlöw wrote:In DIP69, he himself proposed `ref` locals. However, that's not the same as "references a la C++".On Wednesday, 21 January 2015 at 08:22:44 UTC, Per Nordlöw wrote:Walter is strongly against adding references a la C++ to D, as he believes they are too complicated and bug prone. He's made several posts on this, but I can't find them now.int x; auto ref xr;Correction: I, of course mean, int x = 42; auto ref xr = x;
Jan 22 2015