Loading saved files (ok i'm a numpty)

Discussion of programming Lisps using Emacs, including SLIME and other tools

Loading saved files (ok i'm a numpty)

Postby milkybar_ton » Fri Jan 10, 2014 2:49 pm

I have a macbook and have installed lisp-in-a-box.
Trying to work through Practical Common Lisp.
P17 ( i know i haven't gotton very far)
trying to open my saved hello world program
; SLIME 2011-02-04
CL-USER> (load "hello.lisp")
#P"/hello.lisp"

it doesn't work as it doesn't know where to look, or so the book says. I should then quit the debugger by typing q
Unbound variable: Q
[Condition of type UNBOUND-VARIABLE]

Restarts:
0: [CONTINUE] Retry getting the value of Q.
1: [USE-VALUE] Specify a value of Q to use this time.
2: [STORE-VALUE] Specify a value of Q to store and use.
3: [RETRY] Retry SLIME REPL evaluation request.
4: [*ABORT] Return to SLIME's top level.
5: [ABORT-BREAK] Reset this thread
--more--

Backtrace:
0: (CCL::CHEAP-EVAL Q)
--more--

???? i'm then supposed to type a comma and then cd to point emacs to where the file is stored but i can't figure out how to do this

thanks in advance for your infinite patience
milky
milkybar_ton
 
Posts: 6
Joined: Wed Jul 03, 2013 2:30 pm

Re: Loading saved files (ok i'm a numpty)

Postby Goheeca » Fri Jan 10, 2014 4:55 pm

The debuggers' REPLs are implemented slightly different as the CL implementation varies. When you are in the debugger try to type the number of a restart that you want to use or an unambiguous abbreviation of the restart's name. Or just type help or :help for more information how to use a debugger.
cl-2dsyntax is my attempt to create a Python-like reader. My mirror of CLHS (and the dark themed version).
User avatar
Goheeca
 
Posts: 199
Joined: Thu May 10, 2012 12:54 pm

Re: Loading saved files (ok i'm a numpty)

Postby nuntius » Fri Jan 10, 2014 8:07 pm

Hi Milky,

The procedure you describe sounds right, but the results you describe are clearly wrong.
The "q" to exit a restart prompt, and the REPL ",cd" to change directories are written on the Emacs side of Slime and should be portable across all CL implementations.

2011 is rather old for CCL and Slime; you may have hit an old bug. What does (lisp-implementation-version) say? You might reconsider using lisp-in-a-box.

Today, it is quite easy to install everything from scratch; it should take less than 30 minutes. Installation is basically downloading three files and running some simple commands. Quicklisp gives easy access to hundreds of libraries.

- Install Emacs: http://aquamacs.org/ or http://emacsformacosx.com/
- Install CCL: http://ccl.clozure.com/download.html
- Install quicklisp: http://www.quicklisp.org/beta/ and then use quicklisp-slime-helper to get Slime
User avatar
nuntius
 
Posts: 498
Joined: Sat Aug 09, 2008 10:44 am
Location: Burlington, MA

Re: Loading saved files (ok i'm a numpty)

Postby milkybar_ton » Sun Jan 12, 2014 6:23 am

Thanks for the help.
unfortunately i've got the slowest and least reliable of internet connections at the moment so i can't try loading the files separately like nuntias suggests ( i tried in the past but didn't get very far )
Installation

Installing SLIME just means putting it into your Emacs load-path and enabling it when you enter lisp-mode. Once the Emacs code is loaded, the Common Lisp code is compiled and loaded automatically and on-demand.

Here is the Elisp code. You can paste this into your ~/.emacs after changing the path on the first line to suit your installation.

(add-to-list 'load-path "/the/path/to/slime")
(require 'slime)
(add-hook 'lisp-mode-hook (lambda () (slime-mode t)))
(add-hook 'inferior-lisp-mode-hook (lambda () (inferior-slime-mode t)))
;; Optionally, specify the lisp program you are using. Default is "lisp"
(setq inferior-lisp-program "yourlisp")

Not sure where my /.emacs file would be? perhaps i need to get a handle on Unix first :D

Anyway i'll potter on in a non-Emacs way with a previously installed free version of LispWorks
i'll drop back in some time in Feb when i get home again
milky
milkybar_ton
 
Posts: 6
Joined: Wed Jul 03, 2013 2:30 pm


Return to Emacs

Who is online

Users browsing this forum: No registered users and 1 guest

cron