| Name | Address | Value | Inferred Type / Role |
|---|---|---|---|
| v1 | 0x04 | 1 | Integer Variable |
| v2 | 0x08 | 2 | Integer Variable |
| checkpoint | 0x12 | 1 | Integer / Boolean Flag |
| ptr | 0x20 | 0x04 | Pointer (Points to v1) |
| ptr_ptr | 0x28 | 0x20 | Pointer to Pointer (Points to ptr) |
This file contains hidden or 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
| (define sq (lambda (n) (* n n))) | |
| (assert (= (sq 5) 25)) ;PASS |
This file contains hidden or 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
| (define sqs (lambda (x y) (+ (sq x) (sq y)))) | |
| (assert (= (sqs 2 3) 13)); PASS |
This file contains hidden or 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
| ;👇 eval operator | |
| (sqs 2 3) | |
| ;👉 (lambda (x y) (+ (sq x) (sq y))) |
This file contains hidden or 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
| ;👇👇 eval operands | |
| (sqs 2 3) | |
| ; 👉 2 | |
| ; 👉 3 |
This file contains hidden or 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
| ;👇 body of the procedure ;👇 arguments | |
| ;(+ (sq x) (sq y))) ; 2 3 | |
| ;applied 👉 (+ (sq 2) (sq 3)) |
This file contains hidden or 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
| (sqs 2 3) | |
| (+ (sq 2) (sq 3)) | |
| (+ (sq 2) (* 3 3)) | |
| (+ (sq 2) 9) | |
| (+ (* 2 2) 9) | |
| (+ 4 9) | |
| 13 |
This file contains hidden or 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
| #include <stdio.h> | |
| int x = 42; | |
| int *p = &x; | |
| printf("The value of p is %p and is pointing to %d\n", p, *p); | |
| // The value of p is 0x1080b8000 and is pointing to 42 |
This file contains hidden or 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
| 0x00000001080b8000 |
This file contains hidden or 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
| #include <stdio.h> | |
| int main() { | |
| int x = 1; | |
| int y = 2; | |
| int checkpoint = 0; | |
| int *ptr = &x; | |
| int **ptr_ptr = &ptr; | |
| checkpoint = **ptr_ptr; | |
| printf("%d\n", checkpoint); // 1 |
NewerOlder