digitalmars.D - Petition to chime in Issue 1553 - foreach_reverse is allowed for
- Denis Shelomovskij (14/14) Oct 20 2013 `foreach_reverse` is allowed for delegates and do what `foreach` do thus...
- Denis Shelomovskij (8/19) Oct 20 2013 Also the funny thing is according to Andrei [1] about `foreach_reverse`
- bearophile (5/6) Oct 20 2013 I suggest to keep foreach_reverse in the language, but statically
- Peter Alexander (8/12) Oct 20 2013 +1
- Marco Leise (9/18) Oct 25 2013 +1
- Dmitry Olshansky (6/17) Oct 20 2013 +1
- Timon Gehr (2/6) Oct 20 2013 This is by design? I thought it was obviously a bug in the implementatio...
- Jesse Phillips (5/18) Oct 20 2013 I don't use foreach_reverse and don't intend to. I allowing
`foreach_reverse` is allowed for delegates and do what `foreach` do thus causing dangerous confusion. Walter Bright is the only one for some obscure reason definitely for not deprecating this feature and WONTFIX-ed the issue. And yes, no big red note in docs about it. As always, this is even more error-prone for highly templated language like D (i.e. one can expect in template `foreach_reverse` will not compile if reverse iteration isn't supported). Petition for all not indifferent to language misfeatures to chime in and show in this thread we all are for deprecating it (if we really are). Issue URL: http://d.puremagic.com/issues/show_bug.cgi?id=1553 Thanks. -- Денис В. Шеломовский Denis V. Shelomovskij
Oct 20 2013
20.10.2013 15:29, Denis Shelomovskij пишет:`foreach_reverse` is allowed for delegates and do what `foreach` do thus causing dangerous confusion. Walter Bright is the only one for some obscure reason definitely for not deprecating this feature and WONTFIX-ed the issue. And yes, no big red note in docs about it. As always, this is even more error-prone for highly templated language like D (i.e. one can expect in template `foreach_reverse` will not compile if reverse iteration isn't supported). Petition for all not indifferent to language misfeatures to chime in and show in this thread we all are for deprecating it (if we really are). Issue URL: http://d.puremagic.com/issues/show_bug.cgi?id=1553 Thanks.Also the funny thing is according to Andrei [1] about `foreach_reverse` over ranges from February 2010: "Gone, that is. Walter agreed to remove it." [1] http://forum.dlang.org/post/hl8345$2b1q$1 digitalmars.com -- Денис В. Шеломовский Denis V. Shelomovskij
Oct 20 2013
Denis Shelomovskij:Issue URL: http://d.puremagic.com/issues/show_bug.cgi?id=1553I suggest to keep foreach_reverse in the language, but statically disallow it on delegates. Bye, bearophile
Oct 20 2013
On Sunday, 20 October 2013 at 12:33:27 UTC, bearophile wrote:Denis Shelomovskij:+1 foreach_reverse is ugly, but works, and there's no point breaking code just to tidy things up a little. foreach_reverse on delegates on the other hand is completely broken, so should be statically disallowed (preferably with a nice error message explaining that the current behaviour is broken!)Issue URL: http://d.puremagic.com/issues/show_bug.cgi?id=1553I suggest to keep foreach_reverse in the language, but statically disallow it on delegates.
Oct 20 2013
Am Sun, 20 Oct 2013 15:55:41 +0200 schrieb "Peter Alexander" <peter.alexander.au gmail.com>:On Sunday, 20 October 2013 at 12:33:27 UTC, bearophile wrote:+1 Often enough I see code that iterates forwards and backwards over something. foreach and foreach_reverse make the syntax look the same. I don't like the idea of plugging in reverse ranges into foreach to get the same effect. -- MarcoDenis Shelomovskij:+1Issue URL: http://d.puremagic.com/issues/show_bug.cgi?id=1553I suggest to keep foreach_reverse in the language, but statically disallow it on delegates.
Oct 25 2013
20-Oct-2013 15:29, Denis Shelomovskij пишет:`foreach_reverse` is allowed for delegates and do what `foreach` do thus causing dangerous confusion. Walter Bright is the only one for some obscure reason definitely for not deprecating this feature and WONTFIX-ed the issue. And yes, no big red note in docs about it. As always, this is even more error-prone for highly templated language like D (i.e. one can expect in template `foreach_reverse` will not compile if reverse iteration isn't supported). Petition for all not indifferent to language misfeatures to chime in and show in this thread we all are for deprecating it (if we really are).+1 At a times it looks as if Walter is in favor of keeping whatever broken junk forever just because it was always broken.Issue URL: http://d.puremagic.com/issues/show_bug.cgi?id=1553 Thanks.-- Dmitry Olshansky
Oct 20 2013
On 10/20/2013 01:29 PM, Denis Shelomovskij wrote:`foreach_reverse` is allowed for delegates and do what `foreach` do thus causing dangerous confusion. Walter Bright is the only one for some obscure reason definitely for not deprecating this feature and WONTFIX-ed the issue. ...This is by design? I thought it was obviously a bug in the implementation.
Oct 20 2013
On Sunday, 20 October 2013 at 11:29:38 UTC, Denis Shelomovskij wrote:`foreach_reverse` is allowed for delegates and do what `foreach` do thus causing dangerous confusion. Walter Bright is the only one for some obscure reason definitely for not deprecating this feature and WONTFIX-ed the issue. And yes, no big red note in docs about it. As always, this is even more error-prone for highly templated language like D (i.e. one can expect in template `foreach_reverse` will not compile if reverse iteration isn't supported). Petition for all not indifferent to language misfeatures to chime in and show in this thread we all are for deprecating it (if we really are). Issue URL: http://d.puremagic.com/issues/show_bug.cgi?id=1553 Thanks.I don't use foreach_reverse and don't intend to. I allowing delegates is error prone if it is just going to do what foreach does.
Oct 20 2013