about summary refs log tree commit diff stats
path: root/shell/macroexpand.mu
Commit message (Collapse)AuthorAgeFilesLines
* all tests passing again; infix seems doneKartik K. Agaram2021-06-221-1/+1
|
* snapshot: infixKartik K. Agaram2021-06-221-2/+2
| | | | | | | | | | | | | | | | | | | | | Like parenthesize, I'm copying tests over from https://github.com/akkartik/wart Unlike parenthesize, though, I can't just transliterate the code itself. Wart was operating on an intermediate AST representation. Here I'm all the way down to cells. That seemed like a good idea when I embarked, but now I'm not so sure. Operating with the right AST data structure allowed me to more easily iterate over the elements of a list. The natural recursion for cells is not a good fit. This patch and the next couple is an interesting case study in what makes Unix so effective. Yes, you have to play computer, and yes it gets verbose and ugly. But just diff and patch go surprisingly far in helping build a picture of the state space in my brain. Then again, there's a steep gradient of skills here. There are people who can visualize state spaces using diff and patch far better than me, and people who can't do it as well as me. Nature, nurture, having different priorities, whatever the reason. Giving some people just the right crutch excludes others.
* .Kartik K. Agaram2021-06-121-6/+6
| | | | | Roll back to commit 70919b45f0. Recent commits add lots of extra function args for dubious benefit.
* eliminate some implicit writes to real screenKartik K. Agaram2021-06-121-6/+6
|
* .Kartik K. Agaram2021-06-091-1/+1
| | | | Add argument to a few functions.
* .Kartik K. Agaram2021-06-081-5/+5
| | | | | | | I wrote a comment about how some code was not covered by tests, and then promptly forgot what it was for. This is why we need tests. Now the hack is gone.
* rename the definition primitive to 'def'Kartik K. Agaram2021-06-041-12/+12
|
* .Kartik K. Agaram2021-05-311-5/+5
|
* .Kartik K. Agaram2021-05-311-0/+2
|
* data.limg now loading properly againKartik K. Agaram2021-05-311-1/+7
|
* clearer testKartik K. Agaram2021-05-311-34/+3
| | | | | It actually has nothing to do with macros. I just wasn't supporting backquotes outside macros before.
* multi-macroexpanding backquote != nested backquoteKartik K. Agaram2021-05-311-1/+129
| | | | | | | | | | | | | | | | | | | | | This was quite difficult to diagnose. The issue I noticed was that brline had stopped working. All the bugs in previous commits were hiding the cause. Once I cleaned them up, I realized the problem was that the `(,x0 ,y0) was triggering the nested-backquote check. The fix was fairly straightforward then (even though I didn't yet understand why). But how to write a test for this? I spent some time trying to do so without defining a macro using literal macros, before I realized: You can't call literal macros; we don't have first-class macros. Trying to insert literal macro support just breaks everything because we have no way to distinguish between a literal macro call and the stage in macroexpand where a symbol has been replaced with its macro definition. How do you explain stuff like this? I grow weary of Lisp. There's still some issue in loading the entire definition of brline from data.limg.
* clean up a few things in macro testsKartik K. Agaram2021-05-311-57/+46
|
* .Kartik K. Agaram2021-05-301-0/+75
|
* .Kartik K. Agaram2021-05-191-0/+13
|
* disallow null tracesKartik K. Agaram2021-05-191-36/+78
| | | | | | We now use traces everywhere for error-checking. Null traces introduce the possibility of changing a functions error response, and therefore its semantics.
* shell: clean up trace for macroexpandKartik K. Agaram2021-05-181-0/+3
|
* all apps working again after null get checkKartik K. Agaram2021-05-071-0/+1
|
* give up on nested backquotes for nowKartik K. Agaram2021-05-071-1/+80
|
* macros almost doneKartik K. Agaram2021-05-061-23/+69
| | | | Just one case left: macros within unquote.
* some more casesKartik K. Agaram2021-05-061-11/+60
|
* first passing test for macroexpandKartik K. Agaram2021-05-061-5/+170
| | | | | | | | In the process I spent a long time tracking down a stray TODO in 108write.subx that I thought would abort but didn't since the switch to baremetal. Then after I reintroduced that assertion I had to go track down a bunch of buffer sizes. Stream sizes continue to be a huge mess.
* shell: macroexpand outermost callKartik K. Agaram2021-05-061-1/+43
|
* back to macros; switch macroexpand to operate in placeKartik K. Agaram2021-05-061-16/+7
|
* .Kartik K. Agaram2021-05-041-0/+17
|
* shell: start implementing macrosKartik K. Agaram2021-05-041-0/+3