aboutsummaryrefslogtreecommitdiffstats
path: root/csc/match.csc
AgeCommit message (Collapse)AuthorFilesLines
2022-08-01Modify the project structure.Rose Hogenson1-80/+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-24Improve the match syntax for constants.Rose Hogenson1-27/+31
I guess you can pattern match using quote as a literal. That's pretty cool.
2022-07-22Fix a bug in matching record types.Rose Hogenson1-1/+2
Running the record matcher has a side-effect (raising *no-match*), so we call it ahead of time to ensure a consistent order of evaluation.
2022-07-20Perform argument conversion.Rose Hogenson1-1/+1
The point of argument conversion is to validate on each function call that the right number of arguments were passed, and to ensure that no function has more than 1 argument. This second condition makes CPS slightly simpler, and ensures that the arguments will all fit in locals. We take the strategy of allocating a vector for each function call. Ideally we would optimize away most of these allocations, but for now I just want it to work.
2022-07-12Remove redundant parentheses in the match macro.Rose Hogenson1-1/+1
I'm marginally reducing verbosity with this change, without sacrificing readability.
2022-07-03Add a diff library.Rose Hogenson1-2/+2
I was hesitant to add a diff library, but it was surprisingly easy. A straightforward application of dynamic programming.
2022-06-29Add pattern matching for record types.Rose Hogenson1-11/+32
I like scheme because it's possible to add any convenient language feature I can think of.
2022-01-14Write a first draft macro expander.Rose Hogenson1-49/+17
Committing it because it compiles. I have to write tests and debug it still.
2022-01-13Rewrite match to use exceptions.Rose Hogenson1-17/+43
This makes the control flow more clear, and eliminates the need to scan the pattern twice. It also makes it easier to add new forms by consolidating the pattern logic in one procedure.
2022-01-11Move scheme compiler into a separate directory.Rose Hogenson1-0/+60