diff options
author | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2008-03-11 21:48:58 -0300 |
---|---|---|
committer | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2008-07-02 19:05:34 -0300 |
commit | cb30367f10f2e38065d336d331afdc50900de76d (patch) | |
tree | 9b78cc1191b3e14cdbe325d47185d42e82c93788 /lisp | |
parent | 953664369cc66ba17c7b9c1939fd9d7f6c6137ad (diff) |
Generic lisp interface bug fixes including:
o Allow calling disassemble in all function types
o Don't limit amount of bytes to generate a hash table
o Allow "unreadable" symbol names to be keywords
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/bytecode.c | 2 | ||||
-rw-r--r-- | lisp/hash.c | 2 | ||||
-rw-r--r-- | lisp/read.c | 19 |
3 files changed, 15 insertions, 8 deletions
diff --git a/lisp/bytecode.c b/lisp/bytecode.c index 8353a13..cc7d1c5 100644 --- a/lisp/bytecode.c +++ b/lisp/bytecode.c @@ -551,6 +551,8 @@ Lisp_Disassemble(LispBuiltin *builtin) name = bytecode = NULL; switch (OBJECT_TYPE(function)) { + case LispFunction_t: + function = function->data.atom->object; case LispAtom_t: name = function; atom = function->data.atom; diff --git a/lisp/hash.c b/lisp/hash.c index 5959330..a6b91ec 100644 --- a/lisp/hash.c +++ b/lisp/hash.c @@ -153,8 +153,6 @@ LispHashKey(LispObj *object, int function) case LispString_t: string = THESTR(object); length = STRLEN(object); - if (length > 32) - length = 32; for (i = 0, key = 0; i < length; i++) key = (key << 1) ^ string[i]; break; diff --git a/lisp/read.c b/lisp/read.c index 283f473..9c70b64 100644 --- a/lisp/read.c +++ b/lisp/read.c @@ -1127,6 +1127,13 @@ LispReadObject(int unintern, read_info *info) collon = 1; string[length++] = ch; symbol = string + 1; + ch = LispGet(); + if (ch == '|') { + quote = ch; + unreadable = 1; + } + else if (ch != EOF) + LispUnget(ch); } else if (ch) { if (islower(ch)) @@ -1220,12 +1227,6 @@ LispReadObject(int unintern, read_info *info) else if (quote == '"') object = LSTRING(string, length); - else if (quote == '|' || (unreadable && !collon)) { - /* Set unreadable field, this atom needs quoting to be read back */ - object = ATOM(string); - object->data.atom->unreadable = 1; - } - else if (collon) { /* Package specified in object name */ symbol[-1] = '\0'; @@ -1236,6 +1237,12 @@ LispReadObject(int unintern, read_info *info) read__stream, read__line); } + else if (quote == '|' || (unreadable && !collon)) { + /* Set unreadable field, this atom needs quoting to be read back */ + object = ATOM(string); + object->data.atom->unreadable = 1; + } + /* Check some common symbols */ else if (length == 1 && string[0] == 'T') /* The T */ |