[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] Loading reader-macros before compilation
From: |
Felix |
Subject: |
Re: [Chicken-hackers] Loading reader-macros before compilation |
Date: |
Tue, 31 Jul 2012 23:24:57 +0200 (CEST) |
> How difficult would it be to implement reader-macros at compile time
> without requiring compilation flags; using something like e.g.
> require-extension?
It would be difficult, unfortunately. The reads in all toplevel forms
before expanding and canonicalizing them (which would load extensions
and execute compile-time code). This is an architectural limitation
and can be considered a design flaw. On the other hand it clearly
separates the read- and expansion phases, and intermixing read-time
processing with compile-time processing /may/ introduce issues that
often occur in Lisp code between compile- and run-time behaviour.
Reader macros also render source code non-portable. But these are only
lame excuses, of course...
Changing this would require heavy modifications in "batch-driver.scm",
I'm afraid.
If only "autocompile" needs to be enhanced, then it might be an option
to allow some sort of hack to shove options into the source code,
something like:
#!/usr/bin/env chicken-scheme
;; AUTOCOMPILE: -X bisque-colored-parens -O99 -and -make -it -burn
(print "Hello, world!")
Would that be of any use?
cheers,
felix