有人能准确地告诉我 sb-ext:run-program 的 args 参数应该是什么样子吗? ?
如果我这样做:
(sb-ext:run-program "C:/Program Files/iTunes/iTunes.exe"
"C:/lispbox-0.7/opus.mid")
我收到这个错误:
debugger invoked on a TYPE-ERROR:
The value "C:/lispbox-0.7/opus.mid" is not of type LIST.
但是,如果我这样做:
(sb-ext:run-program "C:/Program Files/iTunes/iTunes.exe"
(list "C:\lispbox-0.7\opus.mid"))
iTunes 会打开,但 MIDI 文件不会播放,尽管从 Windows 命令提示符进行的调用工作正常:
U:\>"C:\Program Files\iTunes\iTunes.exe" C:\lispbox-0.7\opus.mid
请注意(带正斜杠):
CL-USER> (sb-ext:run-program "C:/Program Files/iTunes/iTunes.exe"
(list "C:/lispbox-0.7/opus.mid"))
效果相同:iTunes 打开,但不播放文件。
最佳答案
在列表版本中,您使用单个反斜杠,它被解析为转义序列。您需要使用双反斜杠。
关于common-lisp - sb-ext :run-program 的参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4078448/