Args for sb-ext:run-program

2019-07-02 20:57发布

Can someone tell me exactly what the args argument should look like for sb-ext:run-program?

If I do this:

(sb-ext:run-program "C:/Program Files/iTunes/iTunes.exe" 
               "C:/lispbox-0.7/opus.mid")

I get this error:

debugger invoked on a TYPE-ERROR:
  The value "C:/lispbox-0.7/opus.mid" is not of type LIST.

However, if I do this:

(sb-ext:run-program "C:/Program Files/iTunes/iTunes.exe" 
               (list "C:\lispbox-0.7\opus.mid"))

iTunes opens, but the MIDI file doesn't play, even though this invocation from the Windows command prompt works just fine:

U:\>"C:\Program Files\iTunes\iTunes.exe" C:\lispbox-0.7\opus.mid

Note that this (with forward slashes):

CL-USER> (sb-ext:run-program "C:/Program Files/iTunes/iTunes.exe" 
               (list "C:/lispbox-0.7/opus.mid"))

has the same effect: iTunes opens, but the file is not played.

1条回答
Luminary・发光体
2楼-- · 2019-07-02 21:35

In the list version you're using single backslashes, which get parsed as escape sequences. You need to use double backslashes.

查看更多
登录 后发表回答