运行方案从命令行

编程入门 行业动态 更新时间:2024-10-23 14:19:37
本文介绍了运行方案从命令行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何在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.

更多推荐

运行方案从命令行

本文发布于:2023-11-14 19:21:20,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1588317.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:命令行   方案

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!