如何在linux(ubuntu)中从终端运行Scheme程序?还有如何从Scheme程序中的命令行接受参数?
How do you run Scheme programs from the terminal in linux(ubuntu)? Also how to accept arguments from the command-line in a Scheme program?
编辑:Im使用DrScheme实现。
Im using the DrScheme implementation.
推荐答案DrScheme方案实现和用于从命令行执行它的名称是 mzscheme 。启动命令行脚本的文档位于此处: Unix脚本(PLT Scheme文档)。此处说明命令行参数的使用:命令行解析(PLT Scheme Documentation) )。
The DrScheme scheme implementation, and the name you use to execute it from the command line, is mzscheme. The documentation for starting a command line script is found here: Unix Scripts (PLT Scheme documentation). Use of the command line args is explained here: Command-line Parsing (PLT Scheme Documentation).
结果是你可以使用这样的shebang脚本:
The upshot is that you can use shebang scripts like this:
#! /usr/bin/env mzscheme #lang scheme/base (...scheme s-exps...)或者如果你想更多地控制 mzscheme 的命令行标志,你需要启动这样的脚本:
or if you want more control over the command line flags for mzscheme, you need to start the script like this:
#! /bin/sh #| exec mzscheme -cu "$0" ${1+"$@"} |# #lang scheme/base (...scheme s-exps...)用来处理命令行参数的函数是 / code>。您可以在第二个链接链接到的文章中找到如何使用它的示例。
The function you use to process command line args is command-line. You will find examples of how to use it in the article linked to by the second link.
更多推荐
运行方案从命令行
发布评论