Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demo of how complex the complex format is #7

Open
lassik opened this issue Nov 11, 2020 · 1 comment
Open

Demo of how complex the complex format is #7

lassik opened this issue Nov 11, 2020 · 1 comment

Comments

@lassik
Copy link
Contributor

lassik commented Nov 11, 2020

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.

  • chibi-scheme complex-format.scm package1.scm parses the self-contained file.
  • chibi-scheme complex-format.scm package2.scm parses the file that uses (include "...").

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
Copy link
Contributor Author

lassik commented Nov 11, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant