Closed
Description
People coming from an imperative programming background might be confused by return
. For example, they might be confused by the fact that move; return (); move
does not ignore the second move
; they might be confused by the need for return
in code like if foo {grab; return ()} {}
; etc. Some options for improving the situation include:
- Renaming
return
to something else (pure
?result
?output
?) - Adding some sort of warnings for uses of
return
that are likely to be confusing (like in themove; return (); move
example above)
We should also give some thought to how we explain it in the tutorials and other documentation.