Thread overview
[Issue 8471] New: std.stdio.readf
Jul 30, 2012
bioinfornatics
[Issue 8471] std.stdio.readf should be @trusted
July 30, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8471

           Summary: std.stdio.readf
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody@puremagic.com
        ReportedBy: bioinfornatics@gmail.com


--- Comment #0 from bioinfornatics <bioinfornatics@gmail.com> 2012-07-30 05:23:01 PDT ---
http://dlang.org/phobos/std_stdio.html#readf

why readf do not use reference ? as :

uint readf(Data...)(in char[] format, ref Data data);


it is not possible? I think this little thing could enhance to have a D cohesive syntax. Of course D support pointer but ref is more in D spirit and point C spirit. They are not many phobos function where need a pointer or an address.


Thanks, i hope my talk is not stupid

kind regards

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


Andrei Alexandrescu <andrei@metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |andrei@metalanguage.com
         Resolution|                            |WONTFIX


--- Comment #1 from Andrei Alexandrescu <andrei@metalanguage.com> 2012-07-30 06:50:18 PDT ---
When readf was defined, ref didn't work with variadics. Closing because fixing behavior now would break existing code.

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


bearophile_hugs@eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs@eml.cc


--- Comment #2 from bearophile_hugs@eml.cc 2012-07-30 07:01:56 PDT ---
(In reply to comment #1)
> When readf was defined, ref didn't work with variadics. Closing because fixing behavior now would break existing code.

Maybe a less bug prone and different named function should be added, that uses ref...

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


Andrei Alexandrescu <andrei@metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WONTFIX                     |
            Summary|std.stdio.readf             |std.stdio.readf should be
                   |                            |@trusted


--- Comment #3 from Andrei Alexandrescu <andrei@metalanguage.com> 2012-07-30 08:11:42 PDT ---
Actually it's not that bad - readf is not bug prone because it statically ensures that all of its parameters are pointers. Using pointers is also safe because readf doesn't escape them. Actually I'm reopening this with a different title.

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