Why not std.io instead of std.stdio?
Derek Parnell
derek at psych.ward
Sat Apr 25 13:18:28 PDT 2009
On Sat, 25 Apr 2009 11:47:53 -0400, Michel Fortin wrote:
> While it seems acceptable to use "stdio" in "std.c.stdio", since we're
> wrapping the C header of the same name, I see little justification in
> repeating the "std" in the module name for "std.stdio". Why not change
> it to "std.io"?
>
> (same comment apply to other "std.std*" modules)
>
> I first noticed the strangeness of this when I was new to D, but today
> I mistakenly wrote "import std.io;", which felt more natural, is
> shorter and reads way better than "import std.stdio;", which triggered
> the question.
The "std" is the package name. Here "std" is an abbreviation for "standard"
and in this context in means "a package that is supported by the compiler
manufacturer".
The "stdio" is the module within that package that contains standard I/O
routines. In this context, "standard" does not mean "ones supported by the
compiler manufacturer" but "ones that are commonly used" or such.
It is possible to have another I/O module in the same package that does not
contain standard I/O routines but implements non-standard, or specialized,
ones.
It seems that Mr Bright has a particular love for overloading the semantics
of words in order to minimize the number of unique words in play.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
More information about the Digitalmars-d
mailing list