View mode: basic / threaded / horizontal-split · Log in · Help
May 10, 2006
Re: Why std.stdio and not std.io ?
Derek Parnell schrieb:
> "std.stdio" is the Standard I/O module in the "std" package. It allows for
> such things as "std.extio" which might be an Extended I/O module but still
> in the "std" package. In other words "stdio" describes an I/O module as
> 'standard' and "std." describes a package as 'standard'.

Following that logic std.math should be called std.stdmath because it 
might get extended by std.extmath?
Why don't just leave out the prefix for standard modules?

Nils
May 10, 2006
Re: Why std.stdio and not std.io ?
On Wed, 10 May 2006 08:42:25 +0200, Nils Hensel wrote:

> Derek Parnell schrieb:
>> "std.stdio" is the Standard I/O module in the "std" package. It allows for
>> such things as "std.extio" which might be an Extended I/O module but still
>> in the "std" package. In other words "stdio" describes an I/O module as
>> 'standard' and "std." describes a package as 'standard'.
> 
> Following that logic std.math should be called std.stdmath because it 
> might get extended by std.extmath?
> Why don't just leave out the prefix for standard modules?
> 

Totally agree - but who has ever accused Walter of being 100% logical ;-)

-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
"Down with mediocracy!"
10/05/2006 5:22:33 PM
May 13, 2006
Re: Why std.stdio and not std.io ?
Lucas Goss wrote:
> Ok that explains std.cstream, but isn't std.ctype a translation of 
> ctype.h? Well I guess it doesn't use any C library, but it's essentially 
> a copy ctype.h.

No. The std.c.ctype functions are exactly the same as the corresponding 
C <ctype.h> functions, i.e. they work with code pages, locales, etc. D 
is a unicode language, and the std.ctype functions specifically only 
work with ASCII (use the std.uni functions for unicode). Having the 
separate std.ctype functions is because they are much simpler and faster 
than the std.uni ones.

std.uni isn't called std.unicode because unicode is trademarked.
May 13, 2006
Re: Why std.stdio and not std.io ?
Tom wrote:
> Maybe it sounds as a stupid question but I still wonder why to mimic C include
> name for standard input/output.

'std' is the package for standard D library functions.

'stdio' is the module for accessing the C standard I/O streams stdin, 
stdout, and stderr.

std.c.stdio is for access to the C <stdio.h> functions and declarations.

So the std in std and stdio are two different meanings of 'standard'.
May 13, 2006
Re: Why std.stdio and not std.io ?
Walter Bright wrote:

> std.uni isn't called std.unicode because unicode is trademarked.

But isn't windows and linux also trademarked ? Oh well...

--anders
May 13, 2006
Re: Why std.stdio and not std.io ?
Walter Bright wrote:

> 'stdio' is the module for accessing the C standard I/O streams stdin, 
> stdout, and stderr.

As in "eventually", yes ? There's no stdin in std.stdio at the moment.
(arguably all streams in std.stdio just come from std.c.stdio anyway)

Q: Will readf make it into D 1.0 ?

--anders
May 13, 2006
Re: Why std.stdio and not std.io ?
Anders F Björklund wrote:
> Walter Bright wrote:
> 
>> 'stdio' is the module for accessing the C standard I/O streams stdin, 
>> stdout, and stderr.
> 
> As in "eventually", yes ? There's no stdin in std.stdio at the moment.
> (arguably all streams in std.stdio just come from std.c.stdio anyway)

writef, for example, writes to stdout.


> Q: Will readf make it into D 1.0 ?

sure.
May 13, 2006
Re: Why std.stdio and not std.io ?
Walter Bright wrote:

>> As in "eventually", yes ? There's no stdin in std.stdio at the moment.
>> (arguably all streams in std.stdio just come from std.c.stdio anyway)
> 
> writef, for example, writes to stdout.

That it does, I just meant that it writes to the "regular" 
std.c.stdio.stdout and not any special std.stdio.stdout ?

I guess we have std.cstream.dout, for the "special" stuff ?
along with the other two Streams, that is: din, dout, derr

--anders
May 13, 2006
Re: Why std.stdio and not std.io ?
Anders F Björklund wrote:
> Walter Bright wrote:
> 
>>> As in "eventually", yes ? There's no stdin in std.stdio at the moment.
>>> (arguably all streams in std.stdio just come from std.c.stdio anyway)
>>
>> writef, for example, writes to stdout.
> 
> That it does, I just meant that it writes to the "regular" 
> std.c.stdio.stdout and not any special std.stdio.stdout ?

That's right. You can interleave calls to printf and writef, and it'll 
come out right.
May 13, 2006
Re: Why std.stdio and not std.io ?
Walter Bright wrote:
> 
> std.uni isn't called std.unicode because unicode is trademarked.

It is?  *sigh*  People really need to stop doing that.


Sean
1 2 3
Top | Discussion index | About this forum | D home