Changes

Jump to: navigation, search

GPU621/Chapel

13 bytes removed, 23:42, 29 November 2022
Procedure
== Procedure ==
The primer covers procedures including includes overloading, argument intents and dynamic dispatch.
=== Overloading ===
The prime Chapel allows the user to do the overload function and overload operators.
=== Argument Intents ===
Normal (default) intent means that a formal argument cannot be modified in the body of a procedure.
*Similar to the inout intent, the ref intent causes the value of the actual to change depending on the function. However, while the inout copies the argument in upon entering the function and copies the new value out upon exiting, using a ref intent causes any updates to the formal to immediately affect the call site.
*The out intent causes the actual argument to be ignored when the procedure starts. The actual is assigned the value of the corresponding formal when the routine exits.
 
== Class ==
Like C++, the prime allows the user to create a new type that can contain variables and constants, called fields, as well as functions and iterators called methods. A new class type is declared using the class keyword.
73
edits

Navigation menu