Skip to content

Commit 0ad417b

Browse files
ntreldkorpel
andauthored
[spec/betterc] Tweak docs (#3635)
* [spec/betterc] Tweak docs Add 2 headings. Use DDLINK not `.html`. Add link for Interfacing to C++. Tweaks. * Update spec/betterc.dd Co-authored-by: Dennis <[email protected]> --------- Co-authored-by: Dennis <[email protected]>
1 parent e345ea9 commit 0ad417b

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

spec/betterc.dd

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ $(SPEC_S Better C,
44

55
$(HEADERNAV_TOC)
66

7+
$(H2 $(LNAME2 linking, Linking))
8+
79
$(P It is straightforward to link C functions and libraries into D programs.
810
But linking D functions and libraries into C programs is not straightforward.
911
)
@@ -22,11 +24,14 @@ $(HEADERNAV_TOC)
2224
a subset of D that fits this requirement, called $(B BetterC).
2325
)
2426

27+
$(H2 $(LNAME2 better-c, Better C))
28+
2529
$(IMPLEMENTATION_DEFINED $(B BetterC) is typically enabled by setting the $(TT -betterC)
2630
command line flag for the implementation.
2731
)
2832

29-
$(P When $(B BetterC) is enabled, the predefined $(LINK2 version.html, version) `D_BetterC`
33+
$(P When $(B BetterC) is enabled, the predefined
34+
$(DDLINK spec/version, Conditional Compilation, version) `D_BetterC`
3035
can be used for conditional compilation.
3136
)
3237

@@ -63,7 +68,7 @@ Hello betterC
6368
be tricky, hence removing D's GC from the equation may be worthwhile sometimes.)
6469
)
6570

66-
$(P BetterC and $(LINK2 https://dlang.org/spec/importc.html, ImportC) are very different.
71+
$(NOTE BetterC and $(DDLINK spec/importc, ImportC, ImportC) are very different.
6772
ImportC is an actual C compiler. BetterC is a subset of D that relies only on the
6873
existence of the C Standard library.)
6974

@@ -82,7 +87,7 @@ $(H2 $(LNAME2 retained, Retained Features))
8287
$(LI RAII (yes, it can work without exceptions))
8388
$(LI `scope(exit)`)
8489
$(LI Memory safety protections)
85-
$(LI Interfacing with C++)
90+
$(LI $(DDLINK spec/cpp_interface, Interfacing to C++, Interfacing to C++))
8691
$(LI COM classes and C++ classes)
8792
$(LI `assert` failures are directed to the C runtime library)
8893
$(LI `switch` with strings)
@@ -93,7 +98,7 @@ $(H2 $(LNAME2 retained, Retained Features))
9398

9499
$(H3 $(LNAME2 unittests, Running unittests in `-betterC`))
95100

96-
While, testing can be done without the $(TT -betterC) flag, it is sometimes desirable to run the testsuite in `-betterC` too.
101+
While testing can be done without the $(TT -betterC) flag, it is sometimes desirable to run the testsuite in `-betterC` too.
97102
`unittest` blocks can be listed with the $(DDSUBLINK spec/traits, getUnitTests, `getUnitTests`) trait:
98103

99104
---
@@ -114,7 +119,7 @@ $(GT) dmd -betterC -unittest -run test.d
114119
dmd_runpezoXK: foo.d:3: Assertion `0' failed.
115120
)
116121

117-
However, in `-betterC` `assert` expressions don't use Druntime's assert and are directed to `assert` of the C runtime library instead.
122+
However, in `-betterC`, `assert` expressions don't use Druntime's assert and are directed to `assert` from the C runtime library instead.
118123

119124
$(H2 $(LNAME2 consequences, Unavailable Features))
120125

@@ -125,7 +130,8 @@ $(OL
125130
$(LI TypeInfo and $(DDSUBLINK spec/abi, ModuleInfo, $(TT ModuleInfo)))
126131
$(LI Classes)
127132
$(LI Built-in threading (e.g. $(MREF core, thread)))
128-
$(LI Dynamic arrays (though slices of static arrays work) and associative arrays)
133+
$(LI Dynamic arrays (though slices of static arrays and pointers work))
134+
$(LI Associative arrays)
129135
$(LI Exceptions)
130136
$(LI `synchronized` and $(MREF core, sync))
131137
$(LI Static module constructors or destructors)

0 commit comments

Comments
 (0)