You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
first off i want to say this is a really cool project :D i’ve wanted a language like this ever since i read withoutboats’ post about “notes on a smaller rust”.
one thing that’s always bothered me in rust is how the closure syntax is hard to parse for both humans and compilers. i think something closer to javascript would be easier to read and have a more direct analogy to named function definitions for people who don’t come from a rust or ruby background.
let double = fn(x) x*2;
let divmod = fn(dividend, divisor) {
(dividend/divisor, dividend%divisor)
};
something i also wish rust had is a way to let named functions still capture state from their environment; reusing the fn syntax gives you a natural way to do things like adding generics to a closure while still having a capturing/non-capturing distinction.
The text was updated successfully, but these errors were encountered:
first off i want to say this is a really cool project :D i’ve wanted a language like this ever since i read withoutboats’ post about “notes on a smaller rust”.
one thing that’s always bothered me in rust is how the closure syntax is hard to parse for both humans and compilers. i think something closer to javascript would be easier to read and have a more direct analogy to named function definitions for people who don’t come from a rust or ruby background.
something i also wish rust had is a way to let named functions still capture state from their environment; reusing the
fn
syntax gives you a natural way to do things like adding generics to a closure while still having a capturing/non-capturing distinction.The text was updated successfully, but these errors were encountered: