On Mon, Nov 25, 2013 at 10:10 PM, David A. Wheeler <dwhee...@dwheeler.com> wrote: > John Cowan: >> Dude, you have a hold of the Tar Baby here. R6RS and R7RS libraries >> can't be the result of a macro, neither as a whole nor in part. All >> you've done is trade off one set of portability breakers for another. > > Ugh. In that case, maybe we should just drop the > "readable-kernel-module-contents" > macro altogether, and just write straight code with weird names to > reduce possible namespace problems. > We can include cond-expand guile magic so that it works as-is as a guile > module. > > Alan: Any objections?
None whatsoever. I think Jorg's proposal to make a file (the "shar") that makes the output based on the detected Scheme implementation is good. We could even run the file multiple times to generate different outputs, one for each Scheme supported and detected. I propose this system: 1. We write as if we own the namespace. Select some suitable soup of features from R4RS through R7RS, and define it in comments well in the core implementation file. The core implementation file is then just a bunch of (define ...) forms, possibly with some hooks on options like "CL mode" or "Scheme mode". 2. Write a bunch of "shar"s, which take the original file and transform it to code that a particular Scheme implementation-version accepts. Basically, it just prepends and appends some additional code, probably just plain text, to the core implementation file. The shar can put the entire core implementation file within some sort of (define-library... ) form, if needed. 3. If a particular Scheme implementation-version supports parameters, then the "CL mode" option can be made into a parameter. If not, it can be a global instead. We document this in, say, a USAGE.Chicken or USAGE.Guile-1.8 or whatever file. For example, a "standard R5RS shar" would just wrap the implementation file in something like: #! /bin/sh IN=$1 OUT=$2 cat > $OUT <<PREFIX (define (readable%is-cl-mode) readable%cl-mode) (define readable%cl-mode #f) (define readable%whatevers (let () PREFIX cat $IN >> $OUT cat > $OUT <<SUFFIX (list sweet-read neoteric-read curly-read) ) ;let ); define readable%whatevers (define sweet-read (car readable%whatevers)) (define neoteric-read (cadr readable%whatevers)) (define curly-read (caddr readable%whatevers)) SUFFIX ------------------------------------------------------------------------------ Sponsored by Intel(R) XDK Develop, test and display web and hybrid apps with a single code base. Download it for free now! http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk _______________________________________________ Readable-discuss mailing list Readable-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/readable-discuss