Every file is a module, the module name is the same as the file name.
int
: Depending on the platform. Forkagami-dart
, See Dart Numbers.double
: 64-bit IEEE 754 floating point.bool
:true
orfalse
null
String
Native Types
:typedef List = native 'List';
There are two types of function
:
- normal function defined in a Kagami module
func Arubaito(a: int, b: String?, {c: bool}): int {
// ...
return 100;
}
- native function (provided by the
Kagami Runtime
)
func readFile(path: String): String = native "io_read_file";
let a: String?; // a is null
let b = 123; // the type of 'b' is int
a = "kagami";
when (b) {
1 => {
// ...
},
2 => {
// ...
},
else => xx(),
}
while (b > 100) {
b -= 1;
}