aboutsummaryrefslogtreecommitdiffstats
path: root/csc/loop.csc
AgeCommit message (Collapse)AuthorFilesLines
2022-08-01Modify the project structure.Rose Hogenson1-419/+0
Now the lib directory contains what will eventually end up on the user's /usr/lib/csc. When I write make install, it will copy all of the .csc files from lib into the destination lib directory. This means I can start working on the standard library in lib/scheme.
2022-07-25Slightly improve loop.Rose Hogenson1-35/+28
The advantage to this approach is that the user can modify the loop variables and the variables will be stepped as expected, e.g. (loop for i from 1 to 10 do (set! i (+ 1 i)) collect i) should return '(2 4 6 8 10).
2022-07-24Fix a bug in loop with nested collect statements.Rose Hogenson1-6/+6
2022-07-24Improve the loop macro collect statement.Rose Hogenson1-381/+393
Now you can use multiple collect statements and they will all accumulate into the same variable. I think in common lisp you could collect into the same variable even with collect x into, but it's pretty unclear to me how to do that in Scheme. How would we know that they are the same variable?
2022-07-03Add a diff library.Rose Hogenson1-1/+3
I was hesitant to add a diff library, but it was surprisingly easy. A straightforward application of dynamic programming.
2022-06-28Improve CPS.Rose Hogenson1-1/+2
Goodbye soup. Thanks to "Compiling with Continuations" by Appel.
2022-01-25Nitpick on loop style.Rose Hogenson1-3/+4
2022-01-25Use an exception for loop return.Rose Hogenson1-18/+12
This makes everything a lot easier, as it handles nested loops automatically. My brain wave was storing the returned values in a thunk.
2022-01-25Fix the bugs in loop.Rose Hogenson1-32/+73
It works! Sometimes it emits nested loops!
2022-01-24Finish the loop macro.Rose Hogenson1-157/+338
I also cleaned everything up a lot. Maybe there are still bugs because the test coverage is awful, but for now I'm happy to be done.
2022-01-22Add a loop macro.Rose Hogenson1-0/+194