www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2124] New: Using method or delegate from reduce! template.

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

           Summary: Using method or delegate from reduce! template.
           Product: D
           Version: 2.012
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: bmyers harryanddavid.com


Here's a transcript of Dee Girl's conclusion about this issue. She seems to
know what she's talking about:

This code does not work:


import std.algorithm;

class Sorter {}

class ExternalSorter : Sorter {
    string Merge(string f1, string f2) {
        return f1 ~ f2;
    }

    void Sort() {
        string[] chunk_list = [ "a", "b" ];
        auto mrg = &Merge;
        auto retfile = reduce!(mrg)(chunk_list[0], chunk_list[1..$]);
    }
}

void main(string[] args)
{
    auto s = new ExternalSorter;
    s.Sort;
}

But I know how to make it work because I look at the error message. You go to
std.algorithm and make NxNHelper from private to public. Then inside NxNHelper
also make For from private to public. Then code works.

Maybe bug report to Walter is necessary. Private should work because lookup is
in correct module. It is bug in compiler not library. Can you please? Thank
you, Dee Girl


-- 
May 23 2008
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2124


andrei metalanguage.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED





Many thanks to Dee Girl for finding this bug, and to Brian for relaying it.
Walter is working on eliminating this and related bugs, and also on improving
support for flexible alias matching in templates. We are committed on bringing
a great feature to perfection.


-- 
May 23 2008
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2124


Andrei Alexandrescu <andrei metalanguage.com> changed:

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



07:02:14 PDT ---
Has been fixed a few releases ago.

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