How To Config SublimeREPL for Scheme

Sublime Text is a sophisticated text editor for code, markup and prose.
You’ll love the slick user interface, extraordinary features and amazing performance.

while

Scheme is a functional programming language and one of the two main dialects of the programming language Lisp. Unlike Common Lisp, the other main dialect, Scheme follows a minimalist “Minimalism (computing)”) design philosophy specifying a small standard core with powerful tools for language extension.

Maybe Sublime Text is your favirate editor, reading , and trying to have a try about the exercises there. Then you may want to make Sublime to edit / build / run scheme file.

Below steps can give you a reference guide about how to setup it:

LISP Scheme Interpreter Installation

  1. Install LISP scheme interpreter - SCM. there are several interpreter for scheme - DrRacket, MIT-Scheme. but SCM may be the easist one to integrate with Sublime.
  2. Add scm bin folder into your system path. e.g.
    1
    set PATH = %PATH%; C:\Program Files (x86)\scm\

then verify it using command line

1
2
3
4
5
6
7
8
9
C:\Users\Administrator>scm
SCM version 5f2, Copyright (C) 1990-2006 Free Software Foundation.
SCM comes with ABSOLUTELY NO WARRANTY; for details type (terms).
This is free software, and you are welcome to redistribute it
under certain conditions; type (terms) for details.
;loading C:\Program Files (x86)\slib\require
;done loading C:\Program Files (x86)\slib\require.scm
;loading C:\Program Files (x86)\scm\Transcen
;done loading C:\Program Files (x86)\scm\Transcen.scm

REPL installation in Sublime Text 3

  1. Open the package installation of Sublime Text, if not install yet, plz try Tools -> Install Package Control

  2. Install Package “Scheme”

  3. Install Package “SublimeREPL”

  4. Then, open Preferences -> Browse Packages -> SublimeREPL -> config -> Scheme -> Main.sublime-menu, edit the section with the “id”: “repl_scheme” :

    1
    "windows": ["scm", "-f", "$file_basename"]}
  5. Save and restart Sublime Text, choose the target file, Open Tools -> Build System, you may find “Scheme” is auto selected. if not, plz choose “Scheme”

  6. Try build/run the file via Tools -> Build

  7. If you meet error like “File Not Find”, [“gsi”,”-:d-“,”your-file-path”], it may be caused that your configuration are override by Scheme package. then you may go to C:\Users\Adminstrator\AppData\Roaming\Sublime Text 3\Installed Packages, find the scheme package “Scheme.sublime-package”, unzip it and modify the startup command line in the file “Scheme.sublime-build”, change it to :

1
2
3
4
5
{
"cmd": ["scm", "-f", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.scheme"
}
Stay Foolist, Stay Hungry<br><br>Open Source Help Each Other<br><br>Thanks