Am 25.11.2013 23:16, schrieb David A. Wheeler:
David A. Wheeler scripsit:
How about cond-expands at the beginning to handle much of the shimming,
On Mon, 25 Nov 2013 12:08:47 -0500, John Cowan <co...@mercury.ccil.org> wrote:
As of the last time I looked, cond-expand wasn't supported by Racket,
Scheme48/scsh, Larceny, Ypsilon, S7, or Sizzle.

Whow!  What an impressive list!

It just gets worser and worser.

Putting the text in *different* files and leaving them there *also*
appears to be non-portable:
* R5RS "load" doesn't guarantee that loading is relative to the directory
   of the current file (or provide any other guarantee about current directory),
   and has no "include" at all.
* R7RS does have "include" (4.1.7. Inclusion), though it merely
   "encourages" searching the same directory as the caller of include
   (and certainly doesn't guarantee searching there FIRST, so it's just
   begging for security vulnerabilities just like PATH=".:$PATH").

Plus: different compilers will need specific care anyway. After all, you don't want to use "load" at all, since it may compile into a call to "load" with a given file name, which defeats the very purpose of compilation.

Maybe it's time to break out cpp or sed :-(, or use some other
tool to generate various files for different Scheme implementations.

At this point it might be rather easy to explain a second (and more general) use case of my idea of having a Scheme reader which returns comments are nodes in the AST. I already wrote such a tool for my own purpose (even though does currently not include comments in the translated files, which is not bad in principle, but still bad in practise).

Helps me to expand cond-expand sections, overcome my inability to get hygienic macros work in rscheme and expand some parsers written using lalr for chicken. It even implements the "make" macro from PLT (which I tested by writing a replacement of the make process for chicken)... Neatly a tool but see below...

The "configure" program already modifies the file anyway, so that might not be 
insane.

Hm. Depends on the stance you take wrt. "configure".  ;-/

At the least, I could put things in different files, and then use "cat"
to create files usable to different systems.

Not too bad and idea. While it might not scale to whole programs, it's certainly a valid way to get things done for something the size of a srfi's implementation.

I'll note that my Common Lisp implementation "just works",
and it even overrides the reader.  In contrast, a common answer
seems to be "don't bother trying to write portable Scheme":
http://stackoverflow.com/questions/11062320/writing-portable-scheme-code-is-anything-standard-beyond-r5rs-itself

Thanks for this pointer. It took me to http://www.ccs.neu.edu/home/dorai/scmxlate/ which I have not yet heard about.

There is so much we don't ever see. Maybe I can retire the preprocessor mentioned above. Though probably not: just found out that at minimum I would have to add rscheme to scmxlate. Also it seems a bit hard to use and even harder to use in batch mode.

I *like* Scheme, but it's starting to feel like an abusive relationship :-).


Yeah, sometimes I feel that way too. John, how do you manage to keep a positive mood when dealing with so many implementations?


------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Readable-discuss mailing list
Readable-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/readable-discuss

Reply via email to