hkust-taco / mlscript

The MLscript programming language. Functional and object-oriented; structurally typed and sound; with powerful type inference. Soon to have full interop with TypeScript!
https://hkust-taco.github.io/mlscript
MIT License
175 stars 27 forks source link

Add imperative features #208

Closed LPTK closed 10 months ago

LPTK commented 10 months ago

This is to add support for mutable local variables (mut let), mutable fields (mut val), and while loops (while ... do ...). Reassignment is given syntax set x = t, which clearly distinguishes it from equations, which use a single =.

LPTK commented 10 months ago

@chengluyu Thanks for the helpful review! I'll merge when the conversations are resolved. I've answered all of them.