lispEn 2024-01-11 11:11:35

How to install and configure your IDE for Common Lisp (2024)




See on Github

https://gist.github.com/juan-reynoso/31008f67ce335

00af20cb19a4f2b7bbb


Quicklisp is a library manager for Common Lisp. It works with your existing Common Lisp implementation to download, install, and load any of over 1,500 libraries with a few simple commands.


SLIME  is a Emacs mode for Common Lisp development. Inspired by existing systems such Emacs Lisp and ILISP, we are working to create an environment for hacking Common Lisp in.


Emacs  an extensible, customizable, free/libre text editor — and more.


SBCL is a high performance Common Lisp compiler.

Install SBCL into my Debian 11.5  (x86_64 GNU/Linux)


As super user (root)


1.- Download

wget http://prdownloads.sourceforge.net/sbcl/sbcl-2.2.9-x86-64-linux-binary.tar.bz2


2.-Unpack the tarball

bzip2 -cd sbcl-2.4.0-x86-64-linux-binary.tar.bz2


3.- Change directory

cd sbcl-2.4.0-x86-64-linux


4.- Run install script

./install.sh  OR  sh install.sh


5.- Into your teminal type sbcl

sbcl


You will see


This is SBCL 2.4.0, an implementation of ANSI Common Lisp.
More information about SBCL is available at .

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses.  See the CREDITS and COPYING files in the
distribution for more information.
*


note:  * is the Lisp REPL prompt


Install quicklisp


As your user, not as root


 1.- Download quicklisp:

   wget https://beta.quicklisp.org/quicklisp.lisp

  or

   curl -O https://beta.quicklisp.org/quicklisp.lisp


 2.- Install quicklisp:

   sbcl --load quicklisp.lisp


 3.- To continue with the installation, evaluate:

   (quicklisp-quickstart:install)


few seconds later you will see


==== quicklisp installed ====

    To load a system, use: (ql:quickload "system-name")

    To find system

s, use: (ql:system-apropos "term")

    To load Quicklisp every time you start Lisp, use: (ql:add-to-init-file)

    For more information, see http://www.quicklisp.org/beta/


 4.- Test  quicklisp:

   (ql:system-apropos "postmodern")


5.- Install slime

-  into Lisp REPL * prompt evalute:

  (ql:quickload "quicklisp-slime-helper")


After few seconds you will see

slime-helper.el installed in "/home/you-user/quicklisp/slime-helper.el"


To use, add this to your ~/.emacs:


  (load (expand-file-name "~/quicklisp/slime-helper.el"))

  ;; Replace "sbcl" with the path to your implementation

  (setq inferior-lisp-program "sbcl")


("quicklisp-slime-helper")



6.- Install emacs, emacs-goodies-el and paredit-el into Debian:


aptitude install emacs emacs-goodies-el paredit-el



Now all together, sbcl quicklisp slime emacs for your IDE


Open emacs. Press C-x C-f (C is control). Write ~/.emacs and press enter. Edit .emacs and add:


  (setq inferior-lisp-program "sbcl")


  ;;Load Quicklisp slime-helper

  (load (expand-file-name "~/quicklisp/slime-helper.el"))


  ;;Paredit

  (autoload 'enable-paredit-mode "paredit" "Turn on pseudo

-structural editing of Lisp code." t)

  (add-hook 'emacs-lisp-mode-hook       #'enable-paredit-mode)

  (add-hook 'eval-expression-minibuffer-setup-hook #'enable-paredit-mode)

  (add-hook 'ielm-mode-hook             #'enable-paredit-mode)

  (add-hook 'lisp-mode-hook             #'enable-paredit-mode)

  (add-hook 'lisp-interaction-mode-hook #'enable-paredit-mode)

  (add-hook 'scheme-mode-hook           #'enable-paredit-mode)

  (add-hook 'slime-repl-mode-hook (lambda () (paredit-mode +1)))

  (show-paren-mode 1)


Local systems

Quicklisp includes ASDF2. I like to set up ASDF2 to scan a particular directory tree, ~/src/lisp/, for local systems. To do that, I create a config file named ~/.config/common-lisp/source-registry.conf.d/projects.conf that has this in it:

(:tree (:home "src/lisp/"))


The final part is done

Open your emacs and type M-x slime


Making a small Lisp project with quickproject and Quicklisp

https://xach.livejournal.com/278047.html?


Sources

https://www.quicklisp.org/beta/

https://common-lisp.net/project/slime/

https://www.gnu.org/software/emacs/

http://www.sbcl.org/

http://blog.quicklisp.org/


#lisp#commonlisp #ide #programming #development #environment




También te puede interesar
lisp codeEn 2022-07-13 13:12:00