Those look really nice, they could especially be used in tutorials. I'm
replicating some D1 examples from the dsource page to be D2 compatible, and I
could add a bunch of more D2 examples as well.
I'd be willing to write some tutorials for these if they get their way into
Phobos.
Jesse Philli
Mafi Wrote:
> That sounds really cool. Having things like this in the std lib would
> allow you to write great consistent utilities with simple and short
> code. If such functions will ever get into phobos (what I really hope),
> they should get their own module. What do you thinke about
> 'st
Am 17.08.2010 19:10, schrieb Jesse Phillips:
Ali �ehreli Wrote:
A novice should be able to read as simple as
auto d = read!double();
auto i = read!int();
Ignoring stripping whitespace, read can be implemented like this:
T read(T)()
{
T value;
readf("%s",&value);
Ali Ãehreli Wrote:
> A novice should be able to read as simple as
>
> auto d = read!double();
> auto i = read!int();
>
> Ignoring stripping whitespace, read can be implemented like this:
>
> T read(T)()
> {
> T value;
> readf("%s", &value);
> return value;
> }
>
> Ali
Sean Kelly wrote:
> Ali Çehreli Wrote:
>> int i;
>> int j;
>>
>> readf("%s", &i);
>> readf("%s", &j);
>>
>> When the input is
>>
>> 42 43
>>
>> the output is
>>
>> std.conv.ConvError: std.conv(1070): Can't convert value
>> `LockingTextReader(File(807637C), )' of type LockingTe
Ali Ãehreli Wrote:
> Since cstream is deprecated and stdio.readf is finally available with
> 2.048, I started modifying my D book by replacing code like
>
> T var;
> din.readf(&var);
>
> with
>
> T var;
> readf("%s", &var);
>
>
> 1) I couldn't go far, because stdio.readf
Since cstream is deprecated and stdio.readf is finally available with
2.048, I started modifying my D book by replacing code like
T var;
din.readf(&var);
with
T var;
readf("%s", &var);
1) I couldn't go far, because stdio.readf does not ignore whitespace and
code like the fol