The new, new phobos sneak preview

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Apr 6 19:07:10 PDT 2009


BCS wrote:
> Hello Ellery,
> 
>> BCS wrote:
>>
>>> Reply to Andrei,
>>>
>>>> auto a = slurp!(int, double)("filename", "%s, %s");
>>>>
>>>> Each line in the file looks like e.g. "1, 2.3". slurp returns an
>>>> array of Tuple!(int, double) with the parsed content.
>>>>
>>> It would be nice to have a version that would slurp into pre defined
>>> structs.
>>>
>>> struct S{ int i; double d }
>>>
>>> S[] a = slurp!(S)("filename", "%s, %s");
>>>
>> And maybe a burp that spits a tuple back into a file?
>>
> 
> I seconds the name!
> 
> 

I wonder what fart and sniff would do. :o|

On a more (well, only slightly) serious note, the name slurp() is taken 
from perl (google perl slurp), and incidentally burp is around there too.


Andrei



More information about the Digitalmars-d mailing list