Skip to content

Instantly share code, notes, and snippets.

@bvssvni
Created January 14, 2014 07:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bvssvni/8414419 to your computer and use it in GitHub Desktop.
Save bvssvni/8414419 to your computer and use it in GitHub Desktop.
/// Executes a list of expressions.
pub fn exec<Env>(mut a: ~[Expr<(), Env>]) -> Expr<(), Env> {
Expr {
run: proc(env: &mut Env) {
for i in range(0, a.len()) {
let (_, exn) = (a[i].run)(env);
a[i] = exn;
}
((), exec(a))
}
}
}
COMPILER ERROR:
error: cannot assign to immutable vec content
/home/sven/Desktop/prob/src/expr/lib.rs:125 a[i] = exn;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment