pre-srfi / package-scm

The package.scm file format
MIT License
1 stars 1 forks source link

Demo of how complex the complex format is #7

Open lassik opened 3 years ago

lassik commented 3 years ago

To gauge the complexity of supporting include and cond-expand, I wrote a parser using R7RS. It's in complex-format.scm in the experimental directory.

Both should result in the same S-expression. (The program writes the result, preceded by the intermediate steps of the expansion.) The expander is less than 100 lines of code; the most complex part is the cond-expand boolean expression evaluator which is self-contained so it could be made into a more generally useful library routine.

lassik commented 3 years ago

By replacing with-input-from-file with a parameter object, one could easily add a URL-based include expander in addition to the current local-file-system based expander.