1

我正在尝试设置一个别名来访问我的方案解释器。我尝试了以下方法:

set-alias scheme '& "C:\Program Files (x86)\MIT-GNU Scheme\bin\mit-scheme.exe" --library "C:\Program Files (x86)\MIT-GNU Scheme\lib"'

调用时,scheme我收到以下错误消息:

Cannot resolve alias 'scheme' because it refers to term '& "C:\Program Files (x86)\MIT-GNU Scheme\bin\mit-scheme.exe" -
-library "C:\Program Files (x86)\MIT-GNU Scheme\lib"', which is not recognized as a cmdlet, function, operable program,
 or script file. Verify the term and try again.
At line:1 char:7
+ scheme <<<<
    + CategoryInfo          : ObjectNotFound: (scheme:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : AliasNotResolvedException

& "C:\Program Files (x86)\MIT-GNU Scheme\bin\mit-scheme.exe" --library "C:\Program Files (x86)\MIT-GNU Scheme\lib"另一方面,直接调用可以正常工作。

4

1 回答 1

4

别名功能适用于简单的名称别名,不允许使用参数。您需要的是一个功能,例如:

function scheme {
    & "C:\Program Files (x86)\MIT-GNU Scheme\bin\mit-scheme.exe" --library "C:\Program Files (x86)\MIT-GNU Scheme\lib"
}
于 2012-11-29T04:03:13.533 回答