digitalmars.D - Colon and Bracket
- Sjoerd van Leent (122/122) Oct 17 2004 *LONG POST*
- Derek (9/11) Oct 17 2004 [snip]
- Sjoerd van Leent (5/23) Oct 17 2004 Well it is for a general documentation tool. So even if I am at your
- Walter (1/1) Oct 19 2004 The former. -Walter
- Sjoerd van Leent (4/7) Oct 19 2004 Thanks for the information Walter.
*LONG POST* Hello, Currently on the DDoc project (on dsource.org) which I am writing code for right now, I got struck on one specific problem. I have a question regarding colons and brackets (accolades). If I specify code as the following it all goes OK: -- code -- private: public { } public: package: public static { } extern(C): extern(Pascal) { } -- end code -- This can be translated into the following: --- code --- private { public { } } public { } package { public static { } } extern(C) { } extern(Pascal) { } --- end code --- But I am not sure how D acts on the "version" statement. The following works quite well: --- code --- version(SomeVersion) { private: public { } public: package: public static { } extern(C): extern(Pascal) { } } --- end code --- This translates to: --- code --- version(SomeVersion) { private { public { } } public { } package { public static { } } extern(C) { } extern(Pascal) { } } --- end code --- But how should the following be translated? --- code --- version(SomeVersion): private: public { } public: package: public static { } extern(C): extern(Pascal) { } --- end code --- Should it translate as: --- code --- version(SomeVersion) { private { public { } } public { } package { public static { } } extern(C) { } extern(Pascal) { } } --- end code --- or as: --- code --- version(SomeVersion) { } private { public { } } public { } package { public static { } } extern(C) { } extern(Pascal) { } --- end code ---
Oct 17 2004
On Sun, 17 Oct 2004 12:16:33 +0200, Sjoerd van Leent wrote:*LONG POST*[snip]But how should the following be translated?[snip] I don't know, but I've made the decision to only use braces in my code and thus avoid any ambiguities or 'accidents'. Mixing colons and braces is just asking for trouble, IMO. -- Derek Melbourne, Australia
Oct 17 2004
Derek wrote:On Sun, 17 Oct 2004 12:16:33 +0200, Sjoerd van Leent wrote:Well it is for a general documentation tool. So even if I am at your side, others may not be... Regards, Sjoerd*LONG POST*[snip]But how should the following be translated?[snip] I don't know, but I've made the decision to only use braces in my code and thus avoid any ambiguities or 'accidents'. Mixing colons and braces is just asking for trouble, IMO.
Oct 17 2004
Walter wrote:The former. -WalterThanks for the information Walter. Regards, Sjoerd
Oct 19 2004