【发布时间】:2013-10-17 15:44:24
【问题描述】:
这个问题之前肯定有人问过,here。除了Command-line access and exit values 在r6rs-lib 中提到的command-line 函数之外,一些提出的解决方案确实有效(在Windows 中)。
我设法使用*argv* 在Gauche(不符合r6rs 的实现)中实现了我想要的:
(display *argv*)
> gosh test.ss first 1 2 3 4 5 6 7 8 9 10 11 12 13
>> (first 1 2 3 4 5 6 7 8 9 10 11 12 13)
我想使用command-line 函数对r6rs 兼容的Petite Chez Scheme 做同样的事情。我尝试使用该章中的代码,但我得到的只是一个包含脚本名称的列表,并且只有第一个参数。例如
#!r6rs
(import (rnrs programs (6)))
(display (command-line))
> petite --script test.ss first second
>> (test.ss first)
是否还有其他一些我缺少的库导入可以使其正常工作?
【问题讨论】:
标签: command-line arguments scheme r6rs