diff --git a/HOME_EXAM.md b/HOME_EXAM.md index cd809a34970d691e21bb60a482c0bae04073feb8..7c1c0d11fd3559ac7b1c731b325b035c6a101553 100644 --- a/HOME_EXAM.md +++ b/HOME_EXAM.md @@ -606,9 +606,9 @@ fn main() -> () { ``` ```rust -fn b(z: &mut i32, w: &mut i32) -> () { - *z = *z + 1; - *w = *w + 1; +fn b(x: &mut i32, y: &mut i32) -> () { + *x = *x + 1; + *y = *y + 1; }; fn main() -> () { let mut x: i32 = 5; @@ -634,6 +634,8 @@ The borrowchecker should make sure that: This ensures that a variable can not be changed at the same time that another reference tries to read it. +The implementation of the borrow checking is not compleated. It is possible to make references and change the value via the reference. The interpreter does currently not reject illeagal borrows. + ## Conclusion It has been very interesting to learn how a programming language is built. From the lexical analysing where sentences are parsed into tokens to the syntax analysing where the order of the tokens are ckecked. I found it very interesting and instructive to be able to build the AST and parser with the use of lalrpop. It was tricky to understand what should be done in the beginning when both learing lalrpop and rust at the same time. This fell inte place with time and after rewriting the AST compleatly it made alot more sense.