olix3001 / PurrLang

Another attempt at programming language that compiles to scratch blocks.
3 stars 0 forks source link

[FEAT] Explicit type cast expressions #9

Open olix3001 opened 2 months ago

olix3001 commented 2 months ago

Allow users to cast types explicitly using as keyword. This should perform value checks in the future where possible. For example ask("Enter your favourite number") as number cannot possibly check correctness of the value during compilation, but "1.2" as number can.

Type inference here should also be possible, as calling function that expects number should be possible with f(arg as _).

olix3001 commented 2 months ago

This partially works as of 47af798. Only thing that is not implemented is type inference for argument types.