1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-01-17 21:49:22 +01:00

Merge pull request #1763 from amrue/D

[D/en] Fixed two typos and made minor formatting adjustment
This commit is contained in:
Spurlow 2015-10-31 19:20:30 +08:00
commit 8d2dafd3bd

View File

@ -199,8 +199,8 @@ our getter and setter methods, and keep the clean syntax of
accessing members directly! accessing members directly!
Other object-oriented goodies at our disposal Other object-oriented goodies at our disposal
include `interface`s, `abstract class`es, include interfaces, abstract classes,
and `override`ing methods. D does inheritance just like Java: and overriding methods. D does inheritance just like Java:
Extend one class, implement as many interfaces as you please. Extend one class, implement as many interfaces as you please.
We've seen D's OOP facilities, but let's switch gears. D offers We've seen D's OOP facilities, but let's switch gears. D offers
@ -247,7 +247,7 @@ void main() {
// and take advantage of as many cores as we have available. // and take advantage of as many cores as we have available.
auto arr = new double[1_000_000]; auto arr = new double[1_000_000];
// Use an index, and an array element by referece, // Use an index, and an array element by reference,
// and just call parallel on the array! // and just call parallel on the array!
foreach(i, ref elem; parallel(arr)) { foreach(i, ref elem; parallel(arr)) {
ref = sqrt(i + 1.0); ref = sqrt(i + 1.0);