diff --git a/docs/gettingstarted.md b/docs/gettingstarted.md index 2056f97..a1e419f 100644 --- a/docs/gettingstarted.md +++ b/docs/gettingstarted.md @@ -1,14 +1,14 @@ ## 1 - Variables Variables defined using #= can't be changed (they are "final"), while the ones affected using the normal operator (=) can. ``` -helloworld #= "Hello World" +helloworld #= "Hello, World!" ``` ## 2 - (Anonymous) Functions You can make an anonymous functions using the following syntax: ``` getHelloWorld: ~String => { - return "Hello World!" + return "Hello, World!" } ``` `~String` can be omitted, see [#3](#3---types). @@ -32,13 +32,15 @@ as_main helloWorld >> {} ## 3 - Types Types are *inferred*, which means that specifying types of variables or returned values is optional. +Note: While primitives types (`String`, `int`, `double`, `boolean`, `float`) will be transpiled to their equivalents for the target of the transpiler, this is not the case for other types. + Every variable has a static type by default; it is possible to make a **non-final** variable dynamic by adding the `dyn`/`dynamic` attribute: ``` dyn helloWorld = 0 -helloWorld = "Hello World!" +helloWorld = "Hello, World!" ``` The attributes mentioned above can also be used as a return type for functions/anonymous functions: ``` -helloWorld: ~dynamic => {} -dyn helloWorld >> {} +helloWorld: ~dynamic => { return 0 } +dyn helloWorld >> { return 0 } ``` \ No newline at end of file