You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+7-2
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,9 @@ as outlined by Don Yessick for CS403 at the University of Alabama
6
6
This interpreter is feature complete for the language as defined by Yessick
7
7
Notes on choices made:
8
8
9
-
```true```is the truth value
9
+
```true```for truthy values
10
10
11
-
```nil```used for false/nil value
11
+
```nil``` for falsey/nil values
12
12
13
13
```=``` used for equality checking
14
14
@@ -39,6 +39,9 @@ First, move into the ```golisp``` directory that was just created
39
39
40
40
From here, you can use the ```make``` command to compile the interpreter into the executable ```./main``` in the current directory.
41
41
42
+
For submission purposes, ```make``` also runs ```/test/tester.lsp```, which tests every implemented feature in the language
43
+
and outputs the checking to the console
44
+
42
45
Alternatively, you can compile an executable ```./main``` in the current directory.
43
46
```
44
47
$ go build cmd/main.go
@@ -55,3 +58,5 @@ $ ./main file.lsp
55
58
```
56
59
to run ```file.lsp```
57
60
61
+
# About the project
62
+
This project was my second ever project in Go after writing my Lox interpreter. I have to say I enjoyed the language just as much as I did the first go around, and I was again glad I had chosen a language that was both so simple to pick up and so powerful. My largest problems that I ran into in this implementation mainly revolved around working through the underlying workings of the Lisp language that I had not considered before. Once I figured out that everything in the language was either a list or an atom/symbol, it became much easier to work through the implementation. I'll admit that I may not have done everything the most optimally (see my giant switch statements in interpreter/visitExpr.go) but I worked through most things multiple times in order to make it work as intended. An example would be the functions, which I initially attempted to detect at runtime, meaning I just parsed the definition and calls as lists, and tried to work those into definition or call statements at runtime. This nearly broke my brain and produced some code very reminiscent of spaghetti, but after trashing all of my changes and starting over, I managed to make definitions and calls into special cases in the parser that far simplified the process, as I could borrow a lot of the interpretation logic from the Lox interpreter. Other than functions, most of the project was fairly smooth sailing and I'm pretty proud of my ability to bang out a working interpreter without having to follow the guidance of a textbook.
0 commit comments