Closures/Value capture: Difference between revisions
Content added Content deleted
(fixed scheme code to task accordance) |
|||
Line 1,166: | Line 1,166: | ||
=={{header|Rust}}== |
=={{header|Rust}}== |
||
One note here about referencing values and capturing values: <br> |
|||
⚫ | |||
Rust employs strong ownership rules that do not allow mutating a value that is referenced (pointed to without allowing mutation) from elsewhere. It also doesn't allow referencing a value that may be dropped before the reference is released. The proof that we really did capture the value is therefore unnecessary. Either we did or it wouldn't have compiled. |
|||
⚫ | |||
⚫ | |||
} |
|||
⚫ | |||
⚫ | |||
$ rustc rosetta.rs |
|||
⚫ | |||
⚫ | |||
⚫ | |||
{{out}} |
|||
$ ./rosetta |
|||
⚫ | |||
⚫ | |||
=={{header|Scheme}}== |
=={{header|Scheme}}== |