Arc Forumnew | comments | leaders | submitlogin
3 points by almkglor 5910 days ago | link | parent

Hmm. How about a macro which reads in the code from ac.scm and inserts it into a progn form? Would that work?

  (defsyntax insert-file-here ()) ; dunno, never figured out scheme macros

  (module arc-exe mzscheme
    (insert-file-here "ac.scm")
  )
Where (insert-file-here "ac.scm") would expand to:

  (progn
    (provide (all-defined))
    ...
    (define (ac s env)
    ...)
  )
Would putting the defines in (progn ...) work? Sorry, I'm not very good at macros in scheme, never managed to grok hygiene.

The alternative is to have the macros generate the (module ...) code, and insert the code inside the modules of ac.scm and as.scm and what else arc needs.

Basically what I'm proposing is writing a macro which does what you originally did in creating arc-exe.scm. The unfortunate part is that I never managed to grok Scheme macros, otherwise I'd offer to do it for you if you describe how you built arc-exe.scm.



3 points by sacado 5910 days ago | link

Looks like an excellent proposition. I'm not very good with scheme macros either, however I think mzscheme has an à la Common Lisp define-macro extension. I'll look about that more precisely.

-----