adlai/Eos — pull request #3 by 0 (2012-09-28 03:36:46+00:00)
Title: Handle zero-length symbol names in patterns

Symbols with a zero-length name (e.g. the keyword symbol `:||`) break tests. For example:

```lisp
> (keywordp :||)
T
```
```lisp
> (macroexpand-1 '(eos:is (keywordp :||)))
debugger invoked on a SB-INT:INVALID-ARRAY-INDEX-ERROR in thread
#:
Index 0 out of bounds for (SIMPLE-ARRAY CHARACTER
(0)), should be nonnegative and <0.
...
```

This happens because the pattern matcher feeds everything to `varsymp`, but `varsymp` doesn't expect symbol names to not have a first character:

```lisp
> (eos::varsymp :||)
debugger invoked on a SB-INT:INVALID-ARRAY-INDEX-ERROR in thread
#:
Index 0 out of bounds for (SIMPLE-ARRAY CHARACTER
(0)), should be nonnegative and <0.
...
```

I've made the obvious fix to have it check the length first, so the above now work as expected:

```lisp
> (eos::varsymp :||)
NIL
```
```lisp
> (macroexpand-1 '(eos:is (keywordp :||)))
(LET ((#:V1116 :||))
(IF (KEYWORDP #:V1116)
...
T
```