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.
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.
To gauge the complexity of supporting
include
andcond-expand
, I wrote a parser using R7RS. It's incomplex-format.scm
in theexperimental
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.