2

Is there a way in Scheme Revision 5 to call out to an external program? For example:

(system "ls")

If not, is there any "official" way to do this, such as specified in a SRFI or a later revision of the Scheme spec (R6RS, etc)?

Justin Ethier
  • 131,333
  • 52
  • 229
  • 284

1 Answers1

2

No.

(It's generally a bad idea to try to write code with "Standard Scheme", and system is one of those things that is unlikely to become standard enough to be usable outside of a particular implementation or via some compatibility library.)

Eli Barzilay
  • 29,301
  • 3
  • 67
  • 110
  • Good to know - thanks for the answer. I am curious though - why exactly is writing "standard scheme" a bad idea? Is it because individual implementations provide so much in term of their own libraries, packages, etc? – Justin Ethier Feb 24 '11 at 15:12
  • It because the standard is thin enough to inherently not include stuff that specific implementations will always have. It's basically why "Scheme" is better thought of as family of similar languages rather than a specific language. (The specific language view works as long as you stay out of such "real work"). – Eli Barzilay Feb 24 '11 at 15:20
  • I write a lot of code in standard scheme (R5RS) and use popular SRFIs (1,9). So what do you mean by "bad idea"? – knivil Feb 24 '11 at 15:21
  • I meant "for real work" -- anything that requires running subprocesses (as in this case), guis, network connections, concurrency, databases, etc etc. – Eli Barzilay Feb 24 '11 at 16:18
  • OK - I'm not trying to start a flame war or anything. Just trying to understand the Scheme specifications and how they fit into day-to-day programming... – Justin Ethier Feb 24 '11 at 18:06