digitalmars.D - Why std.stdio and not std.io ?
- Tom (6/6) May 09 2006 Maybe it sounds as a stupid question but I still wonder why to mimic C i...
- Stewart Gordon (14/14) May 09 2006 Please note that discussion of this has already begun on d.D.announce.
- Tom (6/20) May 09 2006 I posted in announce and reposted there immediately as I post in there b...
- Lucas Goss (26/28) May 09 2006 I wonder the same. I also wonder why not...
-
Stewart Gordon
(12/25)
May 09 2006
- Lucas Goss (11/23) May 09 2006 Ok that explains std.cstream, but isn't std.ctype a translation of
- Chad J (7/19) May 09 2006 I agree here. Leave the old C naming convention to std.c.* . For all
- Lucas Goss (6/10) May 09 2006 Yeah I asked in the Ares forum about this, and the response was that
- Walter Bright (8/11) May 13 2006 No. The std.c.ctype functions are exactly the same as the corresponding
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (3/4) May 13 2006 But isn't windows and linux also trademarked ? Oh well...
- Sean Kelly (3/5) May 13 2006 It is? *sigh* People really need to stop doing that.
- Daniel Keep (20/28) May 13 2006 Check this out: http://www.unicode.org/policies/logo_policy.html
- John C (3/40) May 14 2006 Surely you're taking this too literally. Both Windows and Linux are
- Daniel Keep (12/54) May 14 2006 Very probably. I *was* half-joking; but still, given what that page
- Stewart Gordon (15/16) May 15 2006 I don't really see how you'd be infringing the trademark by simply using...
- Walter Bright (2/14) May 15 2006 See: http://www.unicode.org/policies/logo_policy.html
- Sean Kelly (10/22) May 15 2006 Technically, I think modules names may be exempt as the language all
- Roberto Mariottini (7/9) May 16 2006 But I think also UNI is:
- Bruno Medeiros (5/14) May 09 2006 Here's a nice usage scenario for code refactoring capabilities. :)
- Derek Parnell (11/15) May 09 2006 "std.stdio" is the Standard I/O module in the "std" package. It allows f...
- Nils Hensel (5/9) May 09 2006 Following that logic std.math should be called std.stdmath because it
- Derek Parnell (8/18) May 10 2006 Totally agree - but who has ever accused Walter of being 100% logical ;-...
- Walter Bright (6/8) May 13 2006 'std' is the package for standard D library functions.
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (5/7) May 13 2006 As in "eventually", yes ? There's no stdin in std.stdio at the moment.
- Walter Bright (3/11) May 13 2006 sure.
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (6/10) May 13 2006 That it does, I just meant that it writes to the "regular"
- Walter Bright (3/12) May 13 2006 That's right. You can interleave calls to printf and writef, and it'll
Maybe it sounds as a stupid question but I still wonder why to mimic C include name for standard input/output. Regards, -- Tom; Argentina
May 09 2006
Please note that discussion of this has already begun on d.D.announce. If you're going to repost a question that's been posted on another 'group, you should always refer to pre-existing discussion. Simply posting the original message verbatim as if it's new is nearly as bad as simple multiposting. Stewart. -- -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS/M d- s:- C++ a->--- UB P+ L E W++ N+++ o K- w++ O? M V? PS- PE- Y? PGP- t- 5? X? R b DI? D G e++++ h-- r-- !y ------END GEEK CODE BLOCK------ My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
May 09 2006
I posted in announce and reposted there immediately as I post in there by mistake, then I posted here. Sorry, In article <e3qg7b$2val$1 digitaldaemon.com>, Stewart Gordon says...Please note that discussion of this has already begun on d.D.announce. If you're going to repost a question that's been posted on another 'group, you should always refer to pre-existing discussion. Simply posting the original message verbatim as if it's new is nearly as bad as simple multiposting. Stewart. -- -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS/M d- s:- C++ a->--- UB P+ L E W++ N+++ o K- w++ O? M V? PS- PE- Y? PGP- t- 5? X? R b DI? D G e++++ h-- r-- !y ------END GEEK CODE BLOCK------ My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.-- Tom;
May 09 2006
Tom wrote:Maybe it sounds as a stupid question but I still wonder why to mimic C include name for standard input/output.I wonder the same. I also wonder why not... std.unicode - instead of std.uni std.c.ctype - instead of std.ctype std.conversion - instead of std.conv std.c.stream? - instead of std.cstream std.memorymappedfile - instead of std.mmfile ...more? And on a related note, why mimic C functions: std.file: isFile - instead of isfile isDirectory - instead of isdir ... std.string: isWhite - instead of iswhite stringToInt - instead of atoi compare - instead of cmp ... Sure it might be nice for C programmers, but a pain for others not familiar with a certain function in C. And using the C counterparts could be as easy as "using std.c.string", etc. I just find readability and consistency to be a huge plus in a library, especially one that is standard. If such changes would be accepted, or even considered, I'd be happy to do the work on this part of the library. I've even thought of re-doing it just for my personal use. Lucas
May 09 2006
Lucas Goss wrote:Tom wrote:<snip> Because std.c.* is reserved for translations of C API headers. Stewart. -- -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS/M d- s:- C++ a->--- UB P+ L E W++ N+++ o K- w++ O? M V? PS- PE- Y? PGP- t- 5? X? R b DI? D G e++++ h-- r-- !y ------END GEEK CODE BLOCK------ My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.Maybe it sounds as a stupid question but I still wonder why to mimic C include name for standard input/output.I wonder the same. I also wonder why not... std.unicode - instead of std.uni std.c.ctype - instead of std.ctype std.conversion - instead of std.conv std.c.stream? - instead of std.cstream std.memorymappedfile - instead of std.mmfile ...more?
May 09 2006
Stewart Gordon wrote: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. The C libraries just seem to clutter up the niceness of D, and make it not so appealing to me. I can see the usefulness of having them to prototype functions until they can be redone later, but using the same naming just seems odd and makes the language feel outdated and hard to read. It also scares me a little because I'm sure someone will bring up the case that the naming can't be changed in the future because of backward compatibility. Makes me sad... LucasI wonder the same. I also wonder why not... std.unicode - instead of std.uni std.c.ctype - instead of std.ctype std.conversion - instead of std.conv std.c.stream? - instead of std.cstream std.memorymappedfile - instead of std.mmfile ...more?<snip> Because std.c.* is reserved for translations of C API headers.
May 09 2006
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. The C libraries just seem to clutter up the niceness of D, and make it not so appealing to me. I can see the usefulness of having them to prototype functions until they can be redone later, but using the same naming just seems odd and makes the language feel outdated and hard to read. It also scares me a little because I'm sure someone will bring up the case that the naming can't be changed in the future because of backward compatibility. Makes me sad... LucasI agree here. Leave the old C naming convention to std.c.* . For all of the D functions, use more descriptive/intuitive and consistant names. I hope the other major libraries (Ares, Mango) will take this to heart as well. I noticed "atoi" in Mango. atoi makes sense if you come from a C background, otherwise you'd have no idea what it does until you read the description.
May 09 2006
Chad J wrote:I hope the other major libraries (Ares, Mango) will take this to heart as well. I noticed "atoi" in Mango. atoi makes sense if you come from a C background, otherwise you'd have no idea what it does until you read the description.Yeah I asked in the Ares forum about this, and the response was that Ares will stay as close as possible to DigitalMars for dmdrt and dmdgc: http://www.dsource.org/forums/viewtopic.php?t=1468 So I'd like to try to get dmdrt and dmdgc changed before it's too late. Lucas
May 09 2006
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
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
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
May 13 2006
Check this out: http://www.unicode.org/policies/logo_policy.html Sounds pretty heavy-handed. If you wanted to use 'unicode' in the name of the module, it looks like it would have to be named: std/supportfortheunicode™standard.d And yes, that ™ MUST be there (at least, they say it must). This'd be funny in the D docs: "To use the D functions in support of the Unicode™ Standard, you should import the support for the Unicode™ Standard standard module like so: "import std.longAnnoyingJavaStyleNames.supportForTheUnicode" (Alt+0153) "Standard;" If you're not running Windows, then... umm... I dunno... use copy and paste?" Whilst according to their own policy, the abbreviation "Uni-" is generic enough that it isn't protected by trademarks. In that light, viva la "std.uni" :) -- Daniel Sean Kelly wrote:Walter Bright wrote:-- v1sw5+8Yhw5ln4+5pr6OFma8u6+7Lw4Tm6+7l6+7D a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP http://hackerkey.com/std.uni isn't called std.unicode because unicode is trademarked.It is? *sigh* People really need to stop doing that. Sean
May 13 2006
Daniel Keep wrote:Check this out: http://www.unicode.org/policies/logo_policy.html Sounds pretty heavy-handed. If you wanted to use 'unicode' in the name of the module, it looks like it would have to be named: std/supportfortheunicode™standard.d And yes, that ™ MUST be there (at least, they say it must). This'd be funny in the D docs: "To use the D functions in support of the Unicode™ Standard, you should import the support for the Unicode™ Standard standard module like so: "import std.longAnnoyingJavaStyleNames.supportForTheUnicode" (Alt+0153) "Standard;" If you're not running Windows, then... umm... I dunno... use copy and paste?" Whilst according to their own policy, the abbreviation "Uni-" is generic enough that it isn't protected by trademarks. In that light, viva la "std.uni" :) -- Daniel Sean Kelly wrote:Surely you're taking this too literally. Both Windows and Linux are trademarked, and yet the std library uses those as module/file names.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
May 14 2006
John C wrote:Daniel Keep wrote:Very probably. I *was* half-joking; but still, given what that page says, I'd go with 'uni' myself just to make absolutely sure. Their trademark policy only seems to cover using their name in product descriptions, etc. In any case, I think Walter made the right choice. Incidentally, I never knew that Unicode had a logo. Guess no one uses it because of the trademark stuff :P Aah, intellectual property law is such fun... -- Daniel -- v1sw5+8Yhw5ln4+5pr6OFma8u6+7Lw4Tm6+7l6+7D a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP http://hackerkey.com/Check this out: http://www.unicode.org/policies/logo_policy.html Sounds pretty heavy-handed. If you wanted to use 'unicode' in the name of the module, it looks like it would have to be named: std/supportfortheunicode™standard.d And yes, that ™ MUST be there (at least, they say it must). This'd be funny in the D docs: "To use the D functions in support of the Unicode™ Standard, you should import the support for the Unicode™ Standard standard module like so: "import std.longAnnoyingJavaStyleNames.supportForTheUnicode" (Alt+0153) "Standard;" If you're not running Windows, then... umm... I dunno... use copy and paste?" Whilst according to their own policy, the abbreviation "Uni-" is generic enough that it isn't protected by trademarks. In that light, viva la "std.uni" :) -- Daniel Sean Kelly wrote:Surely you're taking this too literally. Both Windows and Linux are trademarked, and yet the std library uses those as module/file names.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
May 14 2006
Walter Bright wrote: <snip>std.uni isn't called std.unicode because unicode is trademarked.I don't really see how you'd be infringing the trademark by simply using it as part of the name of a library module for Unicode support. Is it really any different from products having names in the form "X for Windows"? Stewart. -- -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS/M d- s:- C++ a->--- UB P+ L E W++ N+++ o K- w++ O? M V? PS- PE- Y? PGP- t- 5? X? R b DI? D G e++++ h-- r-- !y ------END GEEK CODE BLOCK------ My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
May 15 2006
Stewart Gordon wrote:Walter Bright wrote: <snip>See: http://www.unicode.org/policies/logo_policy.htmlstd.uni isn't called std.unicode because unicode is trademarked.I don't really see how you'd be infringing the trademark by simply using it as part of the name of a library module for Unicode support. Is it really any different from products having names in the form "X for Windows"? Stewart.
May 15 2006
Walter Bright wrote:Stewart Gordon wrote:Technically, I think modules names may be exempt as the language all concerns logos, documentation, and packaging. But it's simply not worth the trouble, particularly for a standard library that others are expected to adopt. I currently have a "std.unicode" module in Ares and plan to change it now that I know this. Frankly, I find it exceedingly irritating that an open standard such as Unicode (tm) should have such restrictions, and I wish I could simply thumb my nose at them and adopt a different standard, but such is life. SeanWalter Bright wrote: <snip>See: http://www.unicode.org/policies/logo_policy.htmlstd.uni isn't called std.unicode because unicode is trademarked.I don't really see how you'd be infringing the trademark by simply using it as part of the name of a library module for Unicode support. Is it really any different from products having names in the form "X for Windows"?
May 15 2006
In article <e4anei$2reb$2 digitaldaemon.com>, Walter Bright says...<snip> std.uni isn't called std.unicode because unicode is trademarked.But I think also UNI is: http://www.uni.com/uni/controller/en/ :-) Ciao --- http://www.mariottini.net/roberto/
May 16 2006
Tom wrote:Maybe it sounds as a stupid question but I still wonder why to mimic C include name for standard input/output. Regards, -- Tom; ArgentinaHere's a nice usage scenario for code refactoring capabilities. :) -- Bruno Medeiros - CS/E student http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
May 09 2006
On Tue, 9 May 2006 15:06:18 +0000 (UTC), Tom wrote:Maybe it sounds as a stupid question but I still wonder why to mimic C include name for standard input/output. Regards,"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'. -- Derek (skype: derek.j.parnell) Melbourne, Australia "Down with mediocracy!" 10/05/2006 1:54:35 PM
May 09 2006
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 09 2006
On Wed, 10 May 2006 08:42:25 +0200, Nils Hensel wrote:Derek Parnell schrieb: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"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?
May 10 2006
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
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
Anders F Björklund wrote:Walter Bright wrote:writef, for example, writes to stdout.'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 ?sure.
May 13 2006
Walter Bright wrote: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 --andersAs 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.
May 13 2006
Anders F Björklund wrote:Walter Bright wrote:That's right. You can interleave calls to printf and writef, and it'll come out right.That it does, I just meant that it writes to the "regular" std.c.stdio.stdout and not any special std.stdio.stdout ?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.
May 13 2006