I once prototyped a language that looked somewhat like the following:
```
func main [
init_counter
init_flag
while flag [
update_counter
update_flag
]
]
proc init_counter [
exp counter := 10
]
proc init_flag [
exp flag := true
]
proc update_counter with counter [
counter--
]
proc update_flag with counter, flag [
if counter == 0 [
flag = false
]
]
```
and decided to try implementing a similar 'thing' in rust
```rust
use eprocedural::*;
proc!( init_counter {
let counter = 10;
} defines counter: u32);
proc!( init_flag {
let flag = true;
} defines flag: bool);
proc!( update_counter with counter: u32 {
*counter -= 1;
});
proc!( update_flag with flag: bool, counter: u32 {
if *counter == 0 {
*flag = false
}
});
fn main() {
with!(init_counter);
with!(init_flag);
while flag {
with!(update_counter);
with!(update_flag);
}
}
```
not smart enough for auto type checking though :/