summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
4eee07a)
Most of the other implementations don't have separate cases for end-of-
input and not-open-paren; so don't penalize Lisp because I decided to
make the parser more extendable.
(let ((len (length string)))
(labels ((parse (i)
(let ((len (length string)))
(labels ((parse (i)
- (cond ((>= i len)
- (values nil i))
- ((char= (char string i) #\()
+ (cond ((and (< i len) (char= (char string i) #\())
(multiple-value-bind (left i) (parse (1+ i))
(unless (< i len) (error "no data"))
(let ((data (char string i)))
(multiple-value-bind (left i) (parse (1+ i))
(unless (< i len) (error "no data"))
(let ((data (char string i)))