mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-06 14:56:54 +02:00
Small corrections.
Removed duplicate countDown. Weird leftover words from parallelism statemet General corrections so spelling capitalization
This commit is contained in:
@@ -683,7 +683,7 @@ module OurModule {
|
|||||||
// We can use modules inside of other modules.
|
// We can use modules inside of other modules.
|
||||||
use Time;
|
use Time;
|
||||||
|
|
||||||
// We'll use this a procedure in the parallelism section.
|
// We'll use this procedure in the parallelism section.
|
||||||
proc countdown( seconds: int ){
|
proc countdown( seconds: int ){
|
||||||
for i in 1..seconds by -1 {
|
for i in 1..seconds by -1 {
|
||||||
writeln( i );
|
writeln( i );
|
||||||
@@ -691,7 +691,7 @@ module OurModule {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Submodule of Ourmodule
|
// Submodules of OurModule
|
||||||
// It is possible to create arbitrarily deep module nests.
|
// It is possible to create arbitrarily deep module nests.
|
||||||
module ChildModule {
|
module ChildModule {
|
||||||
proc foo(){
|
proc foo(){
|
||||||
@@ -726,7 +726,7 @@ foo(); // Less explicit call on ChildModule.foo()
|
|||||||
proc main(){
|
proc main(){
|
||||||
|
|
||||||
// Parallelism
|
// Parallelism
|
||||||
// In other languages, parallelism is typically this is done with
|
// In other languages, parallelism is typically done with
|
||||||
// complicated libraries and strange class structure hierarchies.
|
// complicated libraries and strange class structure hierarchies.
|
||||||
// Chapel has it baked right into the language.
|
// Chapel has it baked right into the language.
|
||||||
|
|
||||||
@@ -821,13 +821,6 @@ proc main(){
|
|||||||
// or iterate over indicies
|
// or iterate over indicies
|
||||||
[ idx in myBigArray.domain ] myBigArray[idx] = -myBigArray[idx];
|
[ idx in myBigArray.domain ] myBigArray[idx] = -myBigArray[idx];
|
||||||
|
|
||||||
proc countdown( seconds: int ){
|
|
||||||
for i in 1..seconds by -1 {
|
|
||||||
writeln( i );
|
|
||||||
sleep( 1 );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Atomic variables, common to many languages, are ones whose operations
|
// Atomic variables, common to many languages, are ones whose operations
|
||||||
// occur uninterupted. Multiple threads can both modify atomic variables
|
// occur uninterupted. Multiple threads can both modify atomic variables
|
||||||
// and can know that their values are safe.
|
// and can know that their values are safe.
|
||||||
|
Reference in New Issue
Block a user