Troubleshooting » History » Version 1

Version 1/4 - Next » - Current version
Marcus Pearce, 2014-11-10 06:36 PM


Troubleshooting

Editing text files

If you use a text editor like Textedit (on MacOS) to edit lisp code (e.g., in the .sbclrc or .emacs files), it can insert non-ascii characters for things like curved quotation marks (smart quotes) which won't work. This is one reason (of many) to use Emacs as an editor. You never know, you might find you like it!

Using SBCL within Emacs

Used within Emacs, SBCL will do pathname completion (using TAB) and expansion of "~" into your home directory and other useful things. You can also get previous commands easily.

See here for more on Slime, the Emacs library which achieves this (it is automatically installed by Quicklisp).

The lisp debugger

If you find yourself with something like this:

* (/ 1 0)

debugger invoked on a DIVISION-BY-ZERO:
  arithmetic error DIVISION-BY-ZERO signalled
Operation was SB-KERNEL::DIVISION, operands (1 0).

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [ABORT] Exit debugger, returning to top level.

(SB-KERNEL::INTEGER-/-INTEGER 1 0)
0] 

Then you have typed something that lisp doesn't like. Be sure to read the information and the restart options and enter the appropriate restart number - usually this is the one labelled [ABORT] but, depending on the situation, [CONTINUE] may also be useful.

Updating or reinstalling IDyOM

To update IDyOM simply remove the previously installation from the .../quicklisp/local-projects/ directory and unzip the new version. Then restart Emacs/SBCL/IDyOM as described above.

Using different SQL database systems

You may use different kinds of databases. For example, to create an SQLite database called 'example.db' in directory DIR:

(clsql:connect '("DIR/example.db") :if-exists :old :database-type :sqlite3)

Alternatively, to connect to an existing local MySQL database:

(clsql:connect '("localhost" "example-database" "username" "password") :if-exists :old :database-type :mysql)

See the CLSQL documentation for more on connect and supported databases.

Problems loading foreign database libraries:

Depending on how your system is configured, clsql:connect may give a "Couldn't load foreign libraries" error. In this case, you
need to tell CLSQL where it can find these libraries, e.g.

(clsql:push-library-path "/usr/local/mysql/lib/")

The exact path will depend on your system. Note that, for some database installations these libraries may not have been installed, and you should consult the database documentation.