sscanf() equivalent for D using Phobos library?

BCS ao at pathlink.com
Thu Dec 4 22:10:32 PST 2008


Reply to Jarrett,

> On Thu, Dec 4, 2008 at 9:25 PM, Bill Baxter <wbaxter at gmail.com> wrote:
> 
>> It's scope!  No worries mate! ;-)
>> 
>> But seriously, it does sound heavyweight compared to a single sscanf
>> function call.
>> Honestly, std.stream is just barely functional enough to write the
>> simplest stream code, so I wouldn't be surprised if that's what it
>> takes to scan strings with it.  Not much worse than what it takes to
>> do it with std::stream in c++ though.
>> I'm really talking out of my ass though, because I can probably count
>> on one hand how many times written code to use scanf or stringstream
>> in my life.  If I have to parse input I'm much more likely to reach
>> for the regexp hammer or write a simpler parser.
>> 
> I could never quite figure out why Stream.readf was not separated out
> into a separate function in std.format.  It probably wouldn't be a lot
> of work.
> 

do it, submit patch, become hero. <G>




More information about the Digitalmars-d-learn mailing list