digitalmars.D - The FAQ page ..
- Hasan Aljudy (31/31) Aug 05 2006 This has probably been brought up more than once! but oh well,
- Unknown W. Brackets (10/51) Aug 05 2006 Under:
- Walter Bright (1/1) Aug 05 2006 Thanks to both of you, I'll make corrections.
- Bruno Medeiros (21/22) Aug 08 2006 I know one more in http://digitalmars.com/d/cpptod.html ,Type Traits,
- Stewart Gordon (6/7) Aug 17 2006 And a typo in the process I see:
-
Walter Bright
(3/13)
Aug 18 2006
Some day
.
This has probably been brought up more than once! but oh well, The faq page is misleading, http://digitalmars.com/d/faq.html It's old, contains false and/or useless statements, such as this: [quote] Why is [expletive deleted] printf in D? printf is not typesafe. It's old fashioned. It's not object-oriented. It's not usable with user-defined types. printf is guilty as charged. But it's just so darned useful. Nothing beats it for banging out a quick dump of a value when debugging. Note: printf is actually not really part of D anyway, but since D provides easy access to C's runtime library, D gets it when needed. [/quote] Shouldn't the answer to that should be more like: printf is not part of D, and its use is *not* recommended, use std.stdio.writef and std.stdio.writefln isntead. and: [quote] Will D be open source? The front end for D is open source, and the source comes with the compiler. There is a SourceForge project underway to create a Gnu implementation of D from this. [/quote] I guess gdc hasn't been released yet <g> The question (and answer to) "How do I get printf() to work with strings?" is totally useless and misleading. I was a victim of it for a long time .. that is, before I discovered writefln, which wasn't at the time mentioned very much on the site, if ever. If the question must stay, then shouldn't the answer be something like "Just use writef, it works with D string automagically!". That's all I found (for now at least .. )
Aug 05 2006
Under: When should I use a foreach loop rather than a for? This example: T* end = &foo[length]; for (T* p = &foo[0]; p < pend; ++p) Is incorrect. It should be: T* pend = &foo[length]; for (T* p = &foo[0]; p < pend; ++p) The same mistake repeats in the next example. -[Unknown]This has probably been brought up more than once! but oh well, The faq page is misleading, http://digitalmars.com/d/faq.html It's old, contains false and/or useless statements, such as this: [quote] Why is [expletive deleted] printf in D? printf is not typesafe. It's old fashioned. It's not object-oriented. It's not usable with user-defined types. printf is guilty as charged. But it's just so darned useful. Nothing beats it for banging out a quick dump of a value when debugging. Note: printf is actually not really part of D anyway, but since D provides easy access to C's runtime library, D gets it when needed. [/quote] Shouldn't the answer to that should be more like: printf is not part of D, and its use is *not* recommended, use std.stdio.writef and std.stdio.writefln isntead. and: [quote] Will D be open source? The front end for D is open source, and the source comes with the compiler. There is a SourceForge project underway to create a Gnu implementation of D from this. [/quote] I guess gdc hasn't been released yet <g> The question (and answer to) "How do I get printf() to work with strings?" is totally useless and misleading. I was a victim of it for a long time .. that is, before I discovered writefln, which wasn't at the time mentioned very much on the site, if ever. If the question must stay, then shouldn't the answer be something like "Just use writef, it works with D string automagically!". That's all I found (for now at least .. )
Aug 05 2006
Thanks to both of you, I'll make corrections.
Aug 05 2006
Walter Bright wrote:Thanks to both of you, I'll make corrections.I know one more in http://digitalmars.com/d/cpptod.html ,Type Traits, the following D code is wrong in one or more ways (this is where I found ---- template IsFunctionT(T) { static if ( is(T[]) ) const int IsFunctionT = 1; else const int IsFunctionT = 0; } void test() { typedef int fp(int); assert(IsFunctionT!(fp) == 1); } ---- -- Bruno Medeiros - MSc in CS/E student http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
Aug 08 2006
Walter Bright wrote:Thanks to both of you, I'll make corrections.And a typo in the process I see: "The runtime library is completely open sourc." While we're on this topic, what are your plans for finally updating ctod.html to the fact that writef exists? Stewart.
Aug 17 2006
Stewart Gordon wrote:Walter Bright wrote:I'll fix it.Thanks to both of you, I'll make corrections.And a typo in the process I see: "The runtime library is completely open sourc."While we're on this topic, what are your plans for finally updating ctod.html to the fact that writef exists?Some day <g>.
Aug 18 2006