hexaredecimal / ML

A small general purpose programming language for programming on the JVM. packages: https://smllpkgs.onrender.com/
https://smllang.gitbook.io
Other
14 stars 1 forks source link

Defer #23

Closed hexaredecimal closed 2 months ago

hexaredecimal commented 2 months ago

Implement the defer expression.

fn main(): Unit => { defer print_at_end() println("hello, world") () }

hexaredecimal commented 2 months ago

A nearly complete implementation has been done. The only place where defer does not work is for variable declarations.

val c = defer 10 (* c will get have type unit *)

Honestly I don't see a use case for this but in order to allow the language to flow I'll have to implement it.

hexaredecimal commented 2 months ago

Fully implemented and test. Feature finalized in commit 7bd17c3