mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-29 09:30:20 +02:00
changed some wording in header. added tuple expansion
This commit is contained in:
@@ -17,11 +17,10 @@ Chapel is currently in-development so there are occasional hiccups with
|
|||||||
performance and language features.
|
performance and language features.
|
||||||
The more information you give the Chapel development team about issues you encounter with the language,
|
The more information you give the Chapel development team about issues you encounter with the language,
|
||||||
the better the language gets.
|
the better the language gets.
|
||||||
Feel free to email the team and other developers through the sourceforge email lists at [sourceforge](https://sourceforge.net/p/chapel/mailman)
|
Feel free to email the team and other developers through the [sourceforge email lists](https://sourceforge.net/p/chapel/mailman).
|
||||||
|
|
||||||
If you're really interested in the cutting edge compiler or contributing to the project,
|
If you're really interested in the development of the compiler or contributing to the project,
|
||||||
the git repository for Chapel is open-source at [github](https://github.com/chapel-lang/chapel)
|
[check out the master Github repository](https://github.com/chapel-lang/chapel).
|
||||||
under the Apache v2.0 license
|
|
||||||
|
|
||||||
Installing the Compiler
|
Installing the Compiler
|
||||||
-----------------------
|
-----------------------
|
||||||
@@ -33,7 +32,7 @@ and its as easy as
|
|||||||
3. ```make```
|
3. ```make```
|
||||||
4. ```source util/setchplenv.bash # or .sh or .csh or .fish```
|
4. ```source util/setchplenv.bash # or .sh or .csh or .fish```
|
||||||
|
|
||||||
You will need to ```source util/setchplenv.*``` from the chapel directory every
|
You will need to ```source util/setchplenv.EXT``` from the chapel directory every
|
||||||
time your terminal starts so its suggested that you drop that command in a script
|
time your terminal starts so its suggested that you drop that command in a script
|
||||||
that will get executed on startup (like .bashrc).
|
that will get executed on startup (like .bashrc).
|
||||||
|
|
||||||
@@ -160,10 +159,14 @@ writeln( "(", sameTup[1], ",", sameTup[2], ")" );
|
|||||||
writeln( diffTup );
|
writeln( diffTup );
|
||||||
// Tuples can also be written into.
|
// Tuples can also be written into.
|
||||||
diffTup[1] = -1;
|
diffTup[1] = -1;
|
||||||
// Can also be used to easily write a collection of variables
|
// you can expand tuples as well
|
||||||
// as is common in debugging
|
var (tupInt, tupReal, tupCplx) = diffTup;
|
||||||
|
writeln( diffTup == (tupInt, tupReal, tupCplx) );
|
||||||
|
// Can also be used to easily write a collection of
|
||||||
|
// variables as a list (common in debugging)
|
||||||
writeln( (a,b,thisInt,thatInt,thisBool,thatBool) );
|
writeln( (a,b,thisInt,thatInt,thisBool,thatBool) );
|
||||||
|
|
||||||
|
|
||||||
// Type aliasing
|
// Type aliasing
|
||||||
type chroma = int; // type of a single hue
|
type chroma = int; // type of a single hue
|
||||||
type RGBColor = 3*chroma; // type representing a full color
|
type RGBColor = 3*chroma; // type representing a full color
|
||||||
|
Reference in New Issue
Block a user