summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIan Bertolacci <ian.bertolacci@gmail.com>2015-07-20 13:07:23 -0700
committerIan Bertolacci <ian.bertolacci@gmail.com>2015-07-20 13:07:23 -0700
commit77daaef8ed6d2fed88405cf038d4e5f0b82dc1ef (patch)
treeec756de2f0aa8ef70c208042470185fd7bce1d9f
parentd35d9d213c3ce3ba1bb53aef896898d87e213d58 (diff)
config param changeup
changed some of the wording of the param config example. Namely put the comment immediately below the example. Also added --set to the noteable arguments list. Also changed "compile(?: )?time" to "compile-time"
-rw-r--r--chapel.html.markdown17
1 files changed, 9 insertions, 8 deletions
diff --git a/chapel.html.markdown b/chapel.html.markdown
index b124f54a..520f959d 100644
--- a/chapel.html.markdown
+++ b/chapel.html.markdown
@@ -32,7 +32,7 @@ stderr.writeln( "This goes to standard error" );
var myVar = 10; // 10 is an int, so myVar is implicitly an int
myVar = -10;
var mySecondVar = myVar;
-// var anError; // this would be a compile time error.
+// var anError; // this would be a compile-time error.
// We can (and should) explicitly type things
var myThirdVar: real;
@@ -57,11 +57,11 @@ var my64Real: real(64) = 1.516; // 64 bit (8 bytes) sized real
var intFromReal = myReal : int;
var intFromReal2: int = myReal : int;
-// consts are constants, they cannot be changed after set in runtime
+// consts are constants, they cannot be changed after set in runtime.
const almostPi: real = 22.0/7.0;
-// params are constants whose value must be known statically at compile time
-// Like consts, they cannot be changed during runtime
+// params are constants whose value must be known statically at compile-time
+// Their value cannot be changed.
param compileTimeConst: int = 16;
// The config modifier allows values to be set at the command line
@@ -71,10 +71,10 @@ config var varCmdLineArg: int = -123;
config const constCmdLineArg: int = 777;
// Set with --VarName=Value or --VarName Value at run time
-// config params can be set at compile time
+// config params can be set/changed at compile-time
config param paramCmdLineArg: bool = false;
+// Set config with --set paramCmdLineArg=value at compile-time
writeln( varCmdLineArg, ", ", constCmdLineArg, ", ", paramCmdLineArg );
-// Set config with --set paramCmdLineArg=value at compile time
// refs operate much like a reference in C++
var actual = 10;
@@ -465,7 +465,7 @@ genericProc( 1.0+2.0i, 3.0+4.0i );
// We can also enforce a form of polymorphism with the 'where' clause
// This allows the compiler to decide which function to use.
-// Note: that means that all information needs to be known at compile time.
+// Note: that means that all information needs to be known at compile-time.
// The param modifier on the arg is used to enforce this constraint.
proc whereProc( param N : int ): void
where ( N > 0 ) {
@@ -896,6 +896,7 @@ Builds like other compilers:
```chpl myFile.chpl -o myExe```
-A notable argument:
+Notable arguments:
* ``--fast``: enables a number of optimizations and disables array bounds checks. Should only enable when application is stable.
+ * ```--set <Symbol Name>=<Value>```: set config param <Symbol Name> to <Value> at compile-time