Thread overview
[Issue 3436] New: std.functional.compose with only one function
Oct 22, 2009
David Simcha
Jun 18, 2010
David Simcha
October 22, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3436

           Summary: std.functional.compose with only one function
           Product: D
           Version: 2.035
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: patch
          Severity: minor
          Priority: P2
         Component: Phobos
        AssignedTo: nobody@puremagic.com
        ReportedBy: dsimcha@yahoo.com


--- Comment #0 from David Simcha <dsimcha@yahoo.com> 2009-10-22 12:14:50 PDT ---
import std.functional, std.math;

alias compose!(sqrt) myCompose;


C:\dmd2\windows\bin\..\..\src\phobos\std\functional.d(474): Error: tuple index
0 exceeds 0

Only happens in the degenerate case of only passing one function to compose. Not a terribly severe bug, but might be annoying in some metaprogramming cases, and should ideally be fixed anyhow.

Fix:  Around line 454, check for this as a special case.

static if(fun.length == 1) {
    alias fun[0] doIt;
} else static if (fun.length == 2) {

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 22, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3436


Andrei Alexandrescu <andrei@metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |andrei@metalanguage.com


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 18, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3436


David Simcha <dsimcha@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


--- Comment #1 from David Simcha <dsimcha@yahoo.com> 2010-06-17 18:21:29 PDT ---
Fixed SVN.

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