www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8471] New: std.stdio.readf

reply d-bugmail puremagic.com writes:
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



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: -------
Jul 30 2012
next sibling parent d-bugmail puremagic.com writes:
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



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: -------
Jul 30 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8471


bearophile_hugs eml.cc changed:

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




 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: -------
Jul 30 2012
prev sibling parent d-bugmail puremagic.com writes:
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



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: -------
Jul 30 2012