Common Lisp download Setup Getting Started

Source: Internet
Author: User

Starting point: Download

linux:https://gist.github.com/jteneycke/7947353

Download the latest SBCL & Emacs:
Http://jaist.dl.sourceforge.net/project/sbcl/sbcl/1.3.5/sbcl-1.3.5-x86-windows-binary.msi
Http://mirrors.ustc.edu.cn/gnu/emacs/windows/emacs-24.5-bin-i686-mingw32.zip

Curl-k-O Https://beta.quicklisp.org/quicklisp.lisp
Sbcl–load Quicklisp.lisp
(Quicklisp-quickstart:install:p ath "quicklisp-down/")
(ql:quickload "Quicklisp-slime-helper")

Configure. Emacs

Here through key mapping to solve Emacs start slow.

;;;; . emacs
(setq inhibit-startup-message T)
(setq gnus-inhibit-startup-message T)
(setq frame-title-format "%b")
(tool-bar-mode-1)
(setq default-major-mode ' Text-mode)
(setq Column-number-mode T)
(setq next-screen-context-lines 4);
(setq Kill-ring-max);
(setq Message-log-max T)

;(setq make-backup-files Nil); No backup!
(setq
Backup-by-copying T; Don ' t clobber symlinks
Backup-directory-alist
‘((“.” . "~/.emacs_saves")); Don ' t litter my fs tree
Delete-old-versions T
Kept-new-versions 6
Kept-old-versions 2
Version-control t); Use versioned Backups

(Setq scroll-margin 3
scroll-conservatively 10000)
(Require ' package); M-x list-packages
(Add-to-list ' package-archives
' ("Melpa". "http://melpa.org/packages/") t)
(Add-to-list ' Load-path "~/.emacs.d/elpa/vlf-1.7/")
(package-initialize); auto set Load-path of installed pkg and load them
;; Common Lisp + Slime
(Defun My-load-slime-and-set ()
(interactive) "The Magic of Eclip command"
(Load (expand-file-name "E:/pl/lispstick/quicklisp-down/slime-helper.el"))
(setq inferior-lisp-program "SBCL")
(slime) "M-x Slime"
)
(Global-set-key (kbd "") ' My-load-slime-and-set)

Add to right mouse button context menu

Assuming Emacs is extracted to C:\emacs, start from cmd:
C:\emacs\bin\runemacs.exe-q–load. Emacs
Usually we would like to have a file point right-click on it, put the following save as Right-menu.reg, double-click on the line to run:

Windows Registry Editor Version 5.00
[Hkey_classes_root*\shell\emacs]
@= "Emacs"
[Hkey_classes_root*\shell\emacs\command]
@= "C:\emacs\bin\runemacs.exe-q–load E:\PL\lispstick\.emacs \"%1\ ""

Emacs + Slime Operation

Window
C-x 3 Vertical Split
C-x o move to next window
C-x 0 Kill Current Window
C-x 1 Kill all windows except current window

Buffer
C-x c-f Find and load file
C-x C-w Save As
C-x C-s Save
C-mouse
C-x left/right ARROW Switch buffer
C-x c-q Toggle Read-only/read-write
C-x K Kill Current Buffer

Frame
C-x 5 2 Make New frame
C-x 5 o move to Next frame

Edit:
C-a C-k Kill Whole Line
C-x u undo Last Operaption
C-x z Repeat Last command
ESC n op repead n times

Move:
C-a moves to the beginning of the line (ahead), C-E end
C-v PAGE Down
M-v PAGE Up

Search:
M-x o; vimgrep

Highlight:
M-s h R; Highlight RegExp
M-s h u; unhighlight regexp

Setting:
C-h v A;check variables A ' s value
M-x set-variable Next-screen-context-lines
M: (getenv "HOME")
M: (expand-file-name "~")
M-x Linum-mode; Toggles the line number mode on and off
M-x (require ' vlf-setup); M-x VLF to open very large file

M-x Slime Open Repl Buffer
When the focus is on REPL buffer:
TAB Command Completion
C-enter automatically complements the parentheses and evaluates
C-c M-o Empty Display

When the focus is in text buffer:
C-c C-k compiles the current file and loads
C-c c-l Select a file to load
C-c C-c compiles the TopLevel form at the current cursor.
C-m-q Auto Indent
C-c c] complement closing parenthesis
C-m-a c-m-e m-x Slime-end-of-defun

C-c C-c is the embodiment of Lisp Interactive
C-x C-E is evaluated at the cursor without print
C-m-x evaluation of the current TopLevel form
C-c c-r evaluation of the selected area

C-c < list callers
C-c > List callees

C-c c-t turns on or off the trace at the current cursor.
M-x Slime-untrace-all

Tutorial

ANSI Common LISP:HTTPS//7chan.org/pr/src/ansi_common_lisp_-_paul_graham.pdf

To create a standalone executable program

Lispstick\steel Bank Common lisp\1.1.12
. \sbcl.exe–core Sbcl.core

(Defun main () (print "Hello"))
(Sb-ext:save-lisp-and-die "Hello.exe": TopLevel # ' main:executable t)

. \hello.exe
This file has 31mb!.
I've tried Allegro cl too, too complicated and not successful.

Vim Lisp settings

Vim I am more skilled, there are similar slime called SLIMV:
Https://bitbucket.org/kovisoft/slimv/get/bd61b0a83d66.zip
It automatically detects where the SBCL is installed, and throws it under the Vimfiles/bundle.
. VIMRC Settings:

"Slimv
Let G:paredit_mode = 1 "input ' (' Auto Plus ') '
Let G:paredit_electric_return = 0 "Prevents enter from wrapping ') ' on a separate line
Let G:lisp_rainbow = 1 "More Fancy

Overall

Although Vim also supports Lisp, Emacs supports it better.

Ref

http://www.sbcl.org/manual/

Common Lisp download Setup Getting Started

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.