digitalmars.D - Colon and Bracket
- Sjoerd van Leent <svanleent wanadoo.nl> Oct 17 2004
- Derek <derek psyc.ward> Oct 17 2004
- Sjoerd van Leent <svanleent wanadoo.nl> Oct 17 2004
- "Walter" <newshound digitalmars.com> Oct 19 2004
- Sjoerd van Leent <svanleent wanadoo.nl> Oct 19 2004
*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:*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.
Well it is for a general documentation tool. So even if I am at your side, others may not be... Regards, Sjoerd
Oct 17 2004
Walter wrote:The former. -Walter
Regards, Sjoerd
Oct 19 2004









Sjoerd van Leent <svanleent wanadoo.nl> 