Don wrote: > Jens Mueller wrote: > >Walter Bright wrote: > >>const in D1 is a storage class, in D2 it's a type modifier. The web > >>page needs updating. > > > >I'm attaching an svn diff. Can you apply it? Since one doesn't need to > >care about const then maybe one should drop the complete section. What > >do you think? > >I find this converting tutorial quite useful. Is there anything else > >missing or wrong? I'd like to adjust it because it helps people to add C > >libraries to D. > > > >Jens > > I removed the section entirely for D2. It remains unaltered for D1. > http://www.dsource.org/projects/phobos/changeset/2201
Removing it leaves some questions open. At least the current thread revealed some problems. What about the attached update? Jens
Index: docsrc/htomodule.dd =================================================================== --- docsrc/htomodule.dd (revision 2200) +++ docsrc/htomodule.dd (working copy) @@ -246,17 +246,18 @@ <h4>Const Type Modifiers</h4> - D has $(TT const) as a storage class, not a type modifier. Hence, just - drop any $(TT const) used as a type modifier: + D has $(TT const) as a type modifier almost like C. Additionally (to C's + $(TT const)) $(TT const) in D is transitive (see $(LINK2 const3.html, + Const and Immutable)). Hence, $(CCODE -void foo(const int *p, char *const q); +void foo(const int *p, char *const q, const float *const r); ) becomes: --------------------------- -void foo(int* p, char* q); +void foo(const(int)* p, char* q, const float* r); --------------------------- <h4>Extern Global C Variables</h4>