Troubleshooting » History » Version 1
Marcus Pearce, 2014-11-10 06:36 PM
1 | 1 | Marcus Pearce | h1. Troubleshooting |
---|---|---|---|
2 | 1 | Marcus Pearce | |
3 | 1 | Marcus Pearce | h2. Editing text files |
4 | 1 | Marcus Pearce | |
5 | 1 | Marcus Pearce | If you use a text editor like Textedit (on MacOS) to edit lisp code (e.g., in the <code>.sbclrc</code> or <code>.emacs</code> 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! |
6 | 1 | Marcus Pearce | |
7 | 1 | Marcus Pearce | h2. Using SBCL within Emacs |
8 | 1 | Marcus Pearce | |
9 | 1 | Marcus Pearce | 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. |
10 | 1 | Marcus Pearce | |
11 | 1 | Marcus Pearce | See "here":http://common-lisp.net/project/slime/ for more on Slime, the Emacs library which achieves this (it is automatically installed by Quicklisp). |
12 | 1 | Marcus Pearce | |
13 | 1 | Marcus Pearce | h2. The lisp debugger |
14 | 1 | Marcus Pearce | |
15 | 1 | Marcus Pearce | If you find yourself with something like this: |
16 | 1 | Marcus Pearce | |
17 | 1 | Marcus Pearce | <pre> |
18 | 1 | Marcus Pearce | * (/ 1 0) |
19 | 1 | Marcus Pearce | |
20 | 1 | Marcus Pearce | debugger invoked on a DIVISION-BY-ZERO: |
21 | 1 | Marcus Pearce | arithmetic error DIVISION-BY-ZERO signalled |
22 | 1 | Marcus Pearce | Operation was SB-KERNEL::DIVISION, operands (1 0). |
23 | 1 | Marcus Pearce | |
24 | 1 | Marcus Pearce | Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL. |
25 | 1 | Marcus Pearce | |
26 | 1 | Marcus Pearce | restarts (invokable by number or by possibly-abbreviated name): |
27 | 1 | Marcus Pearce | 0: [ABORT] Exit debugger, returning to top level. |
28 | 1 | Marcus Pearce | |
29 | 1 | Marcus Pearce | (SB-KERNEL::INTEGER-/-INTEGER 1 0) |
30 | 1 | Marcus Pearce | 0] |
31 | 1 | Marcus Pearce | </pre> |
32 | 1 | Marcus Pearce | |
33 | 1 | Marcus Pearce | 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 <code>[ABORT]</code> but, depending on the situation, <code>[CONTINUE]</code> may also be useful. |
34 | 1 | Marcus Pearce | |
35 | 1 | Marcus Pearce | h2. Updating or reinstalling IDyOM |
36 | 1 | Marcus Pearce | |
37 | 1 | Marcus Pearce | To update IDyOM simply remove the previously installation from the <code>.../quicklisp/local-projects/</code> directory and unzip the new version. Then restart Emacs/SBCL/IDyOM as described above. |
38 | 1 | Marcus Pearce | |
39 | 1 | Marcus Pearce | h2. Using different SQL database systems |
40 | 1 | Marcus Pearce | |
41 | 1 | Marcus Pearce | You may use different kinds of databases. For example, to create an SQLite database called 'example.db' in directory <code>DIR</code>: |
42 | 1 | Marcus Pearce | |
43 | 1 | Marcus Pearce | <pre> |
44 | 1 | Marcus Pearce | (clsql:connect '("DIR/example.db") :if-exists :old :database-type :sqlite3) |
45 | 1 | Marcus Pearce | </pre> |
46 | 1 | Marcus Pearce | |
47 | 1 | Marcus Pearce | Alternatively, to connect to an existing local MySQL database: |
48 | 1 | Marcus Pearce | |
49 | 1 | Marcus Pearce | <pre> |
50 | 1 | Marcus Pearce | (clsql:connect '("localhost" "example-database" "username" "password") :if-exists :old :database-type :mysql) |
51 | 1 | Marcus Pearce | </pre> |
52 | 1 | Marcus Pearce | |
53 | 1 | Marcus Pearce | See the "CLSQL documentation":http://clsql.b9.com/manual/ for more on "connect":http://clsql.b9.com/manual/connect.html and "supported databases":http://clsql.b9.com/manual/prerequisites.html#idp8251808. |
54 | 1 | Marcus Pearce | |
55 | 1 | Marcus Pearce | h2. Problems loading foreign database libraries: |
56 | 1 | Marcus Pearce | |
57 | 1 | Marcus Pearce | Depending on how your system is configured, <code>clsql:connect</code> may give a "Couldn't load foreign libraries" error. In this case, you |
58 | 1 | Marcus Pearce | need to "tell CLSQL where it can find these libraries":http://clsql.b9.com/manual/appendix.html#foreignlibs, e.g. |
59 | 1 | Marcus Pearce | |
60 | 1 | Marcus Pearce | <pre> |
61 | 1 | Marcus Pearce | (clsql:push-library-path "/usr/local/mysql/lib/") |
62 | 1 | Marcus Pearce | </pre> |
63 | 1 | Marcus Pearce | |
64 | 1 | Marcus Pearce | 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. |