v1.2.4 constants and parameter default values
MotC » Devlog
v1.2.4 has been released with a couple of nice-to-have language features:
- int, float, bool and strings can be declared as constants, e.g.: const int MAX = 10;
- Parameters can be declared with default values, e.g.: string[] splitString(string str, string separator = ",") { ...
Constants and parameters can be literals (10, "foo", true), other constants (including built-in ones like MATH_PI), or expressions (const LEFT_BUTTON = BASE_BUTTON + 0x01;). Essentially they must evaluate to a constant value at compile time.
Constant/default expressions cannot contain function calls (even if the result is deterministic).
Array, struct and library type parameters (like Image, Data) can have default values, but that default value can only be "null".
Under the hood, the compiler is now better at collapsing constant expressions at compile time, meaning they will compile to more compact and efficient code.
Files
motc-1.2.4.zip 4.7 MB
87 days ago
Get MotC
Download NowName your own price
MotC
Retro game development tool
Status | Released |
Category | Tool |
Author | Tom Mulgrew |
Tags | compiler, development, Retro, tool |
More posts
- v1.2.55 days ago
- v1.2.3 mousewheel() and minor fixesAug 31, 2024
- v1.2.2 variable scoping and web export fixAug 19, 2024
- v1.2.1 add support for array based for loopsAug 01, 2024
- v1.2.0 - Intellisense releaseJul 28, 2024
- Windows export fixApr 18, 2024
- v1.1.0Feb 18, 2024
- v1.0.2Jan 21, 2024
- MotC 1.0.1 (fullscreen mode)Dec 31, 2023
Leave a comment
Log in with itch.io to leave a comment.