~mdw
/
lisp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
infix: Remove redundant progn in loop expander
[lisp]
/
infix.lisp
diff --git
a/infix.lisp
b/infix.lisp
index
a0d320d
..
93ec028
100644
(file)
--- a/
infix.lisp
+++ b/
infix.lisp
@@
-356,9
+356,9
@@
;;;--------------------------------------------------------------------------
;;; Infrastructure for operator definitions.
;;;--------------------------------------------------------------------------
;;; Infrastructure for operator definitions.
-(defun delim (delim &
key
(requiredp t))
+(defun delim (delim &
optional
(requiredp t))
"Parse DELIM, and read the next token. Returns t if the DELIM was found,
"Parse DELIM, and read the next token. Returns t if the DELIM was found,
- or nil if not (and
requiredp
was nil)."
+ or nil if not (and
REQUIREDP
was nil)."
(cond ((eq *token* delim) (get-token) t)
(requiredp (error "expected `~(~A~)'; found ~S" delim *token*))
(t nil)))
(cond ((eq *token* delim) (get-token) t)
(requiredp (error "expected `~(~A~)'; found ~S" delim *token*))
(t nil)))
@@
-413,7
+413,7
@@
(let ((stuff nil))
(loop
(push (parse-infix 0) stuff)
(let ((stuff nil))
(loop
(push (parse-infix 0) stuff)
- (unless (delim '|,|
:requiredp
nil)
+ (unless (delim '|,| nil)
(return)))
(nreverse stuff)))
(return)))
(nreverse stuff)))
@@
-425,7
+425,7
@@
(error "expected symbol; found ~S" *token*))
(push *token* stuff)
(get-token)
(error "expected symbol; found ~S" *token*))
(push *token* stuff)
(get-token)
- (unless (delim '|,|
:requiredp
nil)
+ (unless (delim '|,| nil)
(return)))
(nreverse stuff)))
(return)))
(nreverse stuff)))
@@
-606,7
+606,7
@@
(defopfunc loop operand
(get-token)
(defopfunc loop operand
(get-token)
- (pushval `(loop ,@(
progn (strip-progn (parse-infix 0)
)))))
+ (pushval `(loop ,@(
strip-progn (parse-infix 0
)))))
(defopfunc multiple-value-bind operand
(get-token)
(defopfunc multiple-value-bind operand
(get-token)
@@
-648,18
+648,18
@@
(get-token)
(when (eq *token* '|)|)
(go done))
(get-token)
(when (eq *token* '|)|)
(go done))
- (delim '|,|
:requiredp
nil)
+ (delim '|,| nil)
(go loop))
((symbolp *token*)
(let ((name *token*))
(get-token)
(go loop))
((symbolp *token*)
(let ((name *token*))
(get-token)
- (if (delim '=
:requiredp
nil)
+ (if (delim '= nil)
(push (list name (parse-infix 0)) args)
(push name args))))
(t
(push *token* args)
(get-token)))
(push (list name (parse-infix 0)) args)
(push name args))))
(t
(push *token* args)
(get-token)))
- (when (delim '|,|
:requiredp
nil)
+ (when (delim '|,| nil)
(go loop))
done)))
(delim '|)|)
(go loop))
done)))
(delim '|)|)
@@
-667,7
+667,7
@@
(defun parse-func-name ()
"Parse a function name and return its Lisp equivalent."
(defun parse-func-name ()
"Parse a function name and return its Lisp equivalent."
- (cond ((delim '|(|
:requiredp
nil)
+ (cond ((delim '|(| nil)
(prog1 (parse-infix) (delim '|)|)))
(t (prog1 *token* (get-token)))))
(prog1 (parse-infix) (delim '|)|)))
(t (prog1 *token* (get-token)))))
@@
-692,7
+692,7
@@
(push `(,(parse-func-name) ,(parse-lambda-list)
,@(strip-progn (parse-infix 0)))
clauses)
(push `(,(parse-func-name) ,(parse-lambda-list)
,@(strip-progn (parse-infix 0)))
clauses)
- (unless (delim '|,|
:requiredp
nil)
+ (unless (delim '|,| nil)
(return)))
(delim 'in)
(pushval `(,kind ,(nreverse clauses) ,@(strip-progn (parse-infix 0))))))
(return)))
(delim 'in)
(pushval `(,kind ,(nreverse clauses) ,@(strip-progn (parse-infix 0))))))