Thread overview
[Issue 5130] New: writeln cannot take delegate
Oct 29, 2010
SHOO
Jan 05, 2011
SHOO
Apr 21, 2012
SomeDude
Dec 31, 2012
SomeDude
Jan 01, 2013
Maxim Fomin
October 29, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=5130

           Summary: writeln cannot take delegate
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody@puremagic.com
        ReportedBy: zan77137@nifty.com


--- Comment #0 from SHOO <zan77137@nifty.com> 2010-10-29 08:42:46 PDT ---
writeln, format, Tuple(T).toString and so on cannot take delegate(in trunk
r2116).
This code should compile:

----
import std.stdio;

void main()
{
        writeln({});
}
----

This bug occurred recently.
On dmd 2.042, this bug doesn't occur.

http://ideone.com/iXHoB

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 04, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5130


Andrei Alexandrescu <andrei@metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrei@metalanguage.com


--- Comment #1 from Andrei Alexandrescu <andrei@metalanguage.com> 2011-01-04 09:43:05 PST ---
I wonder if printing the type of the delegate is the smartest thing to do. After all one can always print typeid(...) if that's what's needed.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 05, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5130



--- Comment #2 from SHOO <zan77137@nifty.com> 2011-01-05 07:00:52 PST ---
(In reply to comment #1)
> I wonder if printing the type of the delegate is the smartest thing to do. After all one can always print typeid(...) if that's what's needed.

I think so, too.

However, there is a problem in Tuple.
Because Tuple struct was not able to receive delegate for toString function, I
made it printable as first aid.
As well as Tuple, a problem may occur. Range, container, assert message...
It may be that you had better offer the default print method to support the
generic programming.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 21, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5130


SomeDude <lovelydear@mailmetrash.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lovelydear@mailmetrash.com


--- Comment #3 from SomeDude <lovelydear@mailmetrash.com> 2012-04-21 16:04:10 PDT ---
2.059:

PS E:\DigitalMars\dmd2\samples> rdmd bug.d
402020

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 31, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5130



--- Comment #4 from SomeDude <lovelydear@mailmetrash.com> 2012-12-31 12:37:33 PST ---
Checked on 3 compilers, it compiles and runs.
This one should be closed, I guess.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 01, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=5130


Maxim Fomin <maxim@maxim-fomin.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |maxim@maxim-fomin.ru
         Resolution|                            |FIXED


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