我使用 shebang 表示法创建了一个 guile Scheme 脚本。
这是代码:
#!/usr/local/bin/guile \
-e main -s
!#
(define (fact-iter product counter max-count)
(if (> counter max-count)
product
(fact-iter (* counter product) (+ counter 1) max-count)))
(define (factorial n)
(fact-iter 1 1 n))
(define (main args)
(factorial args)
)
文件名:factScheme.guile
我尝试直接在终端“factScheme.guile”中运行它,我得到了bash factScheme.guile: command not found
如果我使用“./factScheme.guile”并且我得到了Permission Denied。
如果有人能告诉我如何一步一步地在 ubuntu 的终端中实际运行 guile 方案脚本,我将不胜感激。
我在代码中提到的目录中有诡计。我