aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* expand untyped lambda calculus prelude, fix custom ellipses in syntax-rulesHEADmasterGravatar Peter McGoron 2025-07-105-40/+204
| | | | | The evaluator is currently very slow because it is substituting all free variables at define-time. Should change to a custom weak-normal-form evaluator.
* add display-no-eval for debuggingGravatar Peter McGoron 2025-07-103-11/+37
|
* Fix evaluation to do substitutions under lambdas even when evaluating toGravatar Peter McGoron 2025-07-102-15/+46
| | | | | | weak head normal form Also evaluates identifiers when they are looked up
* fix improper list patternsGravatar Peter McGoron 2025-07-093-9/+10
|
* add syntax-error, only evaluate defined terms to weak head normal formGravatar Peter McGoron 2025-07-096-123/+67
|
* clean up syntax-object.scmGravatar Peter McGoron 2025-07-092-75/+114
|
* test normal order evaluationGravatar Peter McGoron 2025-07-091-0/+5
|
* normal order evaluatorGravatar Peter McGoron 2025-07-095-20/+184
|
* debruijnize converts functions to curry formGravatar Peter McGoron 2025-07-035-206/+79
|
* add inject-primitiveGravatar Peter McGoron 2025-07-021-7/+13
|
* Store names in lexical locationsGravatar Peter McGoron 2025-07-024-102/+137
| | | | | | | | | | | | | | | The previous implementation used what amounted to dynamic binding. This is now used for global state (for instance, what the top-level `lambda` is bound to) only. When a location is bound (either through a syntax or variable binder), its lexical location is given a value that describes what the location "is". For variable bindings it is just the special symbol 'variable, but for syntax transformers the value in the lexical location is the syntax transformer (in the examples case, either a syntax-rules expander or a builtin like `lambda`). TODO: replace all instances of `empty-wrap` with an identifier that is bound with a lexical location whose value is the empty wrap value.
* replace location-comparator with free-identifier-comparatorGravatar Peter McGoron 2025-06-284-26/+56
|
* move tests to their own file; use debruijn form to test alpha equivalenceGravatar Peter McGoron 2025-06-285-47/+121
|
* Fix list ellipses pattern matchingGravatar Peter McGoron 2025-06-287-36/+100
| | | | | | A lot of multisyntax was written to use `unwrap-syntax` deliberately, which I now see as a mistake. Implict unwrapping using `syntax-cxr` (and maybe variants like `syntax-vector-ref`) is probably less error prone.
* Change environments in untyped LC to use location comparators instead ofGravatar Peter McGoron 2025-06-285-60/+83
| | | | | | | | | | bound identifier comparators NOTE: location comparators are a non-standard thing equivalent to a free identifier comparator. Should replace later. The previous code would fail when attempting to process identifiers that came from the output of a macro transformer, because those are marked.
* fix self-syntax and shadowing of syntax keywordsGravatar Peter McGoron 2025-06-284-8/+35
|
* first pass at a syntax expander for pure LCGravatar Peter McGoron 2025-06-286-22/+708
|
* reenable testsGravatar Peter McGoron 2025-06-201-2/+2
|
* test (x ... y ... z ...)Gravatar Peter McGoron 2025-06-202-3/+41
|
* add vector patternsGravatar Peter McGoron 2025-06-202-2/+47
|
* add extra tests and fix temporary generation for renamingGravatar Peter McGoron 2025-06-204-27/+95
|
* more list testsGravatar Peter McGoron 2025-06-191-1/+36
|
* self-syntax tests for producerGravatar Peter McGoron 2025-06-191-25/+41
|
* Add ellipsis escape formGravatar Peter McGoron 2025-06-195-40/+77
| | | | | | `(... <template>)` in R6RS+ will escape a single form of ellipses in the production. I personally do not recommend this: overriding the ellipsis with a new identifier is the better approach in all circumstances.
* add support for multiple ellipses in a sequence in producersGravatar Peter McGoron 2025-06-192-17/+35
| | | | | | | | | | Adopts behavior such that x ... ... => {append ((x ...) ...} x ... ... ... => {append {append (((x ...) ...) ...)}} where `{append ...}` occurs at the meta-level after expanding the patterns. (In the code this is done with an accumulator.)
* Rework PNL calculations in pattern producer, fix producer testGravatar Peter McGoron 2025-06-192-27/+49
| | | | | | | Previous PNL calculations calculated the PNL against the entire pattern. This is not useful, because the PNL at each ellipsis pattern is what is useful. This is also nice because it does not require a parameter: the PNL can always be calculated locally.
* pattern testingGravatar Peter McGoron 2025-06-176-36/+130
|
* producerGravatar Peter McGoron 2025-06-165-20/+341
|
* move common procedures for matcher and producer to internalGravatar Peter McGoron 2025-05-028-88/+183
|
* move utils to new library, emit ellipsis dag from matcher compilerGravatar Peter McGoron 2025-04-267-54/+128
| | | | | | | The compiler now returns a DAG implemented as a hash table. The keys are ellipsis group IDs and the values are lists of ellipsis group IDS. When a producer encounters a repeated form, it uses the information in this DAG to confirm that the production is valid.
* document pattern matcher, add ellipsis groupsGravatar Peter McGoron 2025-04-263-111/+191
| | | | | | | | | | | | | | | | | | | | | Add precise definitions, with examples, for concepts like the ellipsis nesting level. This should clarify what the matcher is doing. They should apply to any implementation of the Macrological Fascicle's description of patterns. This also adds ellipsis grouping. This is used to determine which identifiers are allowed to be repeated with each other in output. TODO: The concept of group needs to encompass nested identifiers. For instance (let-values (((name ...) value) ...) body ...) does not allow ((name ...) body ...) but the current system does not handle this.
* reorganize pattern moduleGravatar Peter McGoron 2025-04-255-8/+11
|
* test vectors with matches after an ellipsesGravatar Peter McGoron 2025-04-252-10/+53
|
* support literals as a list of identifiers, test literalsGravatar Peter McGoron 2025-04-252-17/+44
|
* fix nested ellipsesGravatar Peter McGoron 2025-04-252-7/+99
|
* rewrite expanderGravatar Peter McGoron 2025-04-253-145/+276
| | | | | | | | | | | | | Expander now uses dynamically scoped variables. The old lexical scope variable implementation was getting to four nested lambdas, which was unreadable. The dynamic variables are clearly labeled and segregated from the rest of the code. The actual compiler interacts with the dynamic variables through an API. The previous compiler did not handle empty ellipses match properly. This has some more work to fix that.
* fix pattern list creationGravatar Peter McGoron 2025-04-244-20/+38
|
* fix is-ellipsis-listGravatar Peter McGoron 2025-04-241-1/+1
|
* add pattern matcher and some testsGravatar Peter McGoron 2025-04-245-0/+309
|
* add tests for bound-identifier-comparatorGravatar Peter McGoron 2025-04-243-121/+175
|
* start work on the fundamental syntax objectGravatar Peter McGoron 2025-04-237-0/+807