;; First and foremost, install sbcl using the operating systems facilities
;; On my mac, I use brew install sbcl.

;; Now let's install all the required sbcl packages, load sbcl by typing:
$ sbcl

;; Type the following instructions into SBCL, one by one:

(require 'asdf)
(require 'asdf-install)
(asdf-install:install :cl-ppcre)
(asdf-install:install :cl-yacc)
(asdf-install:install :cl-lex)
(asdf-install:install :arnesi)
(asdf-install:install :alexandria)
(asdf-install:install :flexi-streams)

;; For every asdf-install:install you may choose to install system-wide or just for the current user
;; I recommend selecting user installation

;; If gpg authentication is required then press 0 to skip
;; If "Component xxx not found" just select 0: reinitialize source registry and retry

;; We also need to install ieee-floats, but asdf-install fails to do this...
;; We need to do this by hand:
$ cd ~/.sbcl/site
$ git clone https://github.com/marijnh/ieee-floats.git
$ ln -sf $HOME/.sbcl/site/ieee-floats/ieee-floats.asd ~/.sbcl/systems/

;; Now it's time to download cl-meld:
$ cd ~
$ git clone https://github.com/flavioc/cl-meld.git

;; Before you can load up the compiler, you need to patch CL-Yacc so that it supports comments in the source code:

$ cd ~/.sbcl/site/cl-yacc-0.3
$ patch -p0 < ~/cl-meld/yacc-comments.patch
$ cd ~/cl-meld
$ sbcl

;; Type in: (load "load") and you'll see several messages (it's just sbcl compiling and loading everything)
;; To compile a file, just do this:
(cl-meld:meld-compile "path-to-file.meld" "path-to-output-file")

;; If everything went ok you should see "All done. T"
