|
6 | 6 | //! time values and return a type. |
7 | 7 | //! |
8 | 8 | //! Here, we create an an all-encompassing type function, Contribution, |
9 | | -//! that given a summarize function and associated types will call that |
| 9 | +//! that given a summarize function and associated types, will call that |
10 | 10 | //! function with additional logic. |
11 | 11 | //! |
12 | 12 | //! Each call to Contribution with unique parameters returns |
13 | 13 | //! a unique type. |
14 | 14 | //! |
15 | 15 | //! When to use: |
16 | | -//! - When you don't want runtime overhead |
17 | | -//! - When you want incredibly strong type correctness guarantees |
18 | | -//! - this avoids most runtime errors potentially found in other techniques |
19 | | -//! - you can also use @compileError to make certain behaviors illegal |
20 | | -//! 100% at compile time |
21 | | -//! - When you want your structure to be easily extended from Zig code |
| 16 | +//! - When you don't want runtime overhead. |
| 17 | +//! - When you want incredibly strong type correctness guarantees. |
| 18 | +//! - This avoids most runtime errors potentially found in other techniques. |
| 19 | +//! - You can also use @compileError to make certain behaviors illegal |
| 20 | +//! 100% at compile time. |
| 21 | +//! - When you want your structure to be easily extended from Zig code. |
22 | 22 | //! |
23 | 23 | //! When not to use: |
24 | 24 | //! - If you want to store all instances in a variable of a single type |
25 | 25 | //! (there is no single type like in the vtable or @fieldParentPtr examples, |
26 | | -//! so this is not possible) |
| 26 | +//! so this is not possible). |
27 | 27 |
|
28 | 28 | const std = @import("std"); |
29 | 29 |
|
|
0 commit comments