mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-04-26 15:13:56 +00:00
Updated initialiser
This commit is contained in:
parent
06a5fd28ab
commit
808e0cadd2
@ -708,7 +708,7 @@ class MyClass {
|
|||||||
// We also get the compiler-generated initializer, with one argument per field.
|
// We also get the compiler-generated initializer, with one argument per field.
|
||||||
// Note that soon there will be no compiler-generated initializer when we
|
// Note that soon there will be no compiler-generated initializer when we
|
||||||
// define any initializer(s) explicitly.
|
// define any initializer(s) explicitly.
|
||||||
proc MyClass(val : real) {
|
proc init(val : real) {
|
||||||
this.memberInt = ceil(val): int;
|
this.memberInt = ceil(val): int;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user