www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6251] New: D spec should warn about using foreach_reverse on a delegate

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6251

           Summary: D spec should warn about using foreach_reverse on a
                    delegate
           Product: D
           Version: D1 & D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: websites
        AssignedTo: nobody puremagic.com
        ReportedBy: schveiguy yahoo.com


--- Comment #0 from Steven Schveighoffer <schveiguy yahoo.com> 2011-07-05
04:00:17 PDT ---
Currently, foreach_reverse on a delegate is equivalent to using foreach on a
delegate.  A novice user might expect foreach_reverse to somehow force the
delegate to iterate its elements in reverse.  In order to prevent more bugs
being filed on this issue, the documentation should specifically identify that
foreach_reverse on a delegate does not reverse the order of iteration, and so
should not be used.

This is related to bug 1553

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 05 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6251


Steven Schveighoffer <schveiguy yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |spec
                 CC|                            |thecybershadow gmail.com
           Severity|normal                      |minor


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 05 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6251


Stewart Gordon <smjg iname.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |smjg iname.com


--- Comment #1 from Stewart Gordon <smjg iname.com> 2011-07-08 15:05:39 PDT ---
It took me a moment to make sense of it.  So it basically calls the delegate
applied to the body of the foreach statement in the same way as foreach
(element; object) calls the object's opApply on the body of the foreach
statement?

On this basis, surely foreach_reverse over a delegate should be just illegal?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 08 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6251


Jonathan M Davis <jmdavisProg gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jmdavisProg gmx.com


--- Comment #2 from Jonathan M Davis <jmdavisProg gmx.com> 2011-07-08 15:19:55
PDT ---
Bug# 1553

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 08 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6251


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla digitalmars.com
           Severity|minor                       |enhancement


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 24 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6251


Yao Gomez <yao.gomez gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |yao.gomez gmail.com
         Resolution|                            |DUPLICATE


--- Comment #3 from Yao Gomez <yao.gomez gmail.com> 2012-02-06 13:05:24 PST ---
In the comments of issue 1553 there are an initiative to add documentation
about this issue.

*** This issue has been marked as a duplicate of issue 1553 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 06 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6251


Steven Schveighoffer <schveiguy yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|DUPLICATE                   |


--- Comment #4 from Steven Schveighoffer <schveiguy yahoo.com> 2012-02-06
13:48:43 PST ---
(In reply to comment #3)
 In the comments of issue 1553 there are an initiative to add documentation
 about this issue.
This is *not* a duplicate, it's a direct result of Walter closing bug 1553 saying updating the documentation should be fine. This bug report *is* the initiative to add documentation! -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 06 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6251



--- Comment #5 from Yao Gomez <yao.gomez gmail.com> 2012-02-06 13:59:40 PST ---
Ah OK. Apologies.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 06 2012