Created
December 13, 2013 03:30
-
-
Save JarrettBillingsley/7939420 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type ValNum = f64; | |
type ValStr = Rc<~str>; | |
#[deriving(Clone)] | |
enum Value | |
{ | |
Null, | |
Bool(bool), | |
Num(ValNum), | |
String(ValStr), | |
} | |
// And later... | |
// self.stack is of type ~[Value] | |
print!("{}", match self.stack[i] | |
{ | |
Null => ~"null", | |
Bool(b) => b.to_str(), | |
Num(n) => n.to_str(), | |
String(s) => s.borrow().as_slice() | |
}); |
main.rs:291:4: 291:13 error: cannot move out of dereference of & pointer
main.rs:291 String(s) => print!("{}", s.borrow().as_slice())
^~~~~~~~~
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This gives me: