Skip to content

Commit

Permalink
use (labels) instead of (let) + lambda + funcall
Browse files Browse the repository at this point in the history
  • Loading branch information
toshok committed Sep 27, 2011
1 parent e503478 commit c413caa
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions rust-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@
(and (consp pair) (not (listp (cdr pair)))))

(defun flatten (ls)
(let ((flatten2 (lambda (l a)
(if (null l)
a
(funcall flatten2 (cdr l) (append a (if (listp (car l))
(car l)
(list (car l)))))))))
(funcall flatten2 ls '())))
(labels ((flatten2 (l a)
(if (null l)
a
(flatten2 (cdr l) (append a (if (listp (car l))
(car l)
(list (car l))))))))
(flatten2 ls '())))

(defun rust-expandpair (pair)
(if (pairp pair)
Expand Down

0 comments on commit c413caa

Please sign in to comment.