How the setup the environment of MIT-Scheme with slimv in windows 7?

StackOverflow https://stackoverflow.com/questions/17987621

  •  04-06-2022
  •  | 
  •  

質問

I read the source code of slimv\ftplugin\scheme\slimv-scheme.vim

    if exists( 'g:scheme_builtin_swank' ) && g:scheme_builtin_swank
        " MIT Scheme contains a built-in swank server since version 9.1.1
        return 'scheme --eval "(let loop () (start-swank) (loop))"'
    endif

There's no scheme.exe in my system, only find one c:\Program Files\MIT-GNU Scheme\bin\mit-scheme.exe

When I tried to run C:\Program Files\MIT-GNU Scheme\bin>mit-scheme.exe --eval "(let loop () (start- swank) (loop))", there's an error

---------------------------
MIT/GNU Scheme terminating
---------------------------
scheme: can't find a readable default for option --band.
    searched for file all.com in these directories:
    c:\local\mit-scheme
Reason for termination:
Inconsistency detected.
---------------------------

I have tried to load one .scm in Vim and type this command:

:echo SlimvSwankCommand()

And the autodetection was unsuccessful:(

役に立ちましたか?

解決

You need to build a command that runs a swank server inside MIT Scheme. Let's suppose that Scheme is installed in the MIT-GNU Scheme directory on Windows. You also need a swank server for MIT Scheme, e.g. swank-mit-scheme.scm in slimv (taken from SLIME). Then you start MIT Scheme from the command prompt and load the swank server this way:

"C:\Program Files\MIT-GNU Scheme\mit-scheme" --band "C:\Program Files\MIT-GNU Scheme\lib\all.com" --library "C:\Program Files\MIT-GNU Scheme\lib" --load "C:\Program Files\Vim\vimfiles\slime\contrib\swank-mit-scheme.scm"

If you want slimv to run it for you upon pressing ,c then you need to embed the above command in '!start /MIN ...' and pass it to g:slimv_swank_scheme in your _vimrc (remember to enclose each path that contains space in double quotes):

let g:slimv_swank_scheme='!start /MIN "C:\Program Files\MIT-GNU Scheme\mit-scheme" --band "C:\Program Files\MIT-GNU Scheme\lib\all.com" --library "C:\Program Files\MIT-GNU Scheme\lib" --load "C:\Program Files\Vim\vimfiles\slime\contrib\swank-mit-scheme.scm"'

Of course you can use another swank server as well. The main point is to pass the full path to each component in the above command. I suggest that first you try to run the swank server manually from the command prompt. When it's okay you can put it into '!start /MIN ...'.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top