73
edits
Changes
→Class
== Class ==
Like C++, the prime Chapel 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.
class C {
var a, b: int;
}
}
== Record ==
A record type can be declared using the record keyword. A record is a type that can contain variables and constants, called fields, as well as functions and iterators called methods. Records have many similarities to classes, but there are several important differences: