From c0df1972b22ef1521ee8f25e33bfc7dc7ab1ad78 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 16 Aug 2000 21:05:37 +0000 Subject: [PATCH] Don't quote lambda. --- lisp/mail/mailabbrev.el | 8 +++---- lisp/play/landmark.el | 56 ++++++++++++++++++++++------------------------ lisp/textmodes/tex-mode.el | 4 ++-- 3 files changed, 33 insertions(+), 35 deletions(-) diff --git a/lisp/mail/mailabbrev.el b/lisp/mail/mailabbrev.el index 54967bc7b8a..6c08d5ca411 100644 --- a/lisp/mail/mailabbrev.el +++ b/lisp/mail/mailabbrev.el @@ -110,7 +110,7 @@ ;; ;; (add-hook ;; 'mail-setup-hook -;; '(lambda () +;; (lambda () ;; (substitute-key-definition 'next-line 'mail-abbrev-next-line ;; mail-mode-map global-map) ;; (substitute-key-definition 'end-of-buffer 'mail-abbrev-end-of-buffer @@ -139,9 +139,9 @@ :type 'boolean :group 'mail-abbrev :require 'mailabbrev - :set '(lambda (symbol value) - (setq mail-abbrevs-mode value) - (if value (mail-abbrevs-enable) (mail-abbrevs-disable))) + :set (lambda (symbol value) + (setq mail-abbrevs-mode value) + (if value (mail-abbrevs-enable) (mail-abbrevs-disable))) :initialize 'custom-initialize-default :version "20.3") diff --git a/lisp/play/landmark.el b/lisp/play/landmark.el index 15cab857177..a560b026193 100644 --- a/lisp/play/landmark.el +++ b/lisp/play/landmark.el @@ -60,7 +60,7 @@ ;;; concise problem description. ;;;_* Require -(require 'cl) +(eval-when-compile (require 'cl)) ;;;_* From Gomoku @@ -1153,7 +1153,7 @@ because it is overwritten by \"One moment please\"." ;;(setq direction 'lm-n) ;;(get 'lm-n 'lm-s) (defun lm-nslify-wts-int (direction) - (mapcar '(lambda (target-direction) + (mapcar (lambda (target-direction) (get direction target-direction)) lm-directions)) @@ -1166,7 +1166,7 @@ because it is overwritten by \"One moment please\"." (eval (cons 'max l)) (eval (cons 'min l)))))) (defun lm-print-wts-int (direction) - (mapc '(lambda (target-direction) + (mapc (lambda (target-direction) (insert (format "%S %S %S " direction target-direction @@ -1233,14 +1233,14 @@ because it is overwritten by \"One moment please\"." (set-buffer "*lm-blackbox*") (insert "==============================\n") (insert "I smell: ") - (mapc '(lambda (direction) + (mapc (lambda (direction) (if (> (get direction 'smell) 0) (insert (format "%S " direction)))) lm-directions) (insert "\n") (insert "I move: ") - (mapc '(lambda (direction) + (mapc (lambda (direction) (if (> (get direction 'y_t) 0) (insert (format "%S " direction)))) lm-directions) @@ -1295,7 +1295,7 @@ After this limit is reached, lm-random-move is called to push him out of it." ; (* (/ (random 900000) 900000.0) .0001))) ;;;_ : lm-randomize-weights-for (direction) (defun lm-randomize-weights-for (direction) - (mapc '(lambda (target-direction) + (mapc (lambda (target-direction) (put direction target-direction (* (lm-flip-a-coin) (/ (random 10000) 10000.0)))) @@ -1306,7 +1306,7 @@ After this limit is reached, lm-random-move is called to push him out of it." ;;;_ : lm-fix-weights-for (direction) (defun lm-fix-weights-for (direction) - (mapc '(lambda (target-direction) + (mapc (lambda (target-direction) (put direction target-direction lm-initial-wij)) @@ -1390,7 +1390,7 @@ After this limit is reached, lm-random-move is called to push him out of it." 0.0)))) (defun lm-update-normal-weights (direction) - (mapc '(lambda (target-direction) + (mapc (lambda (target-direction) (put direction target-direction (+ (get direction target-direction) @@ -1401,7 +1401,7 @@ After this limit is reached, lm-random-move is called to push him out of it." lm-directions)) (defun lm-update-naught-weights (direction) - (mapc '(lambda (target-direction) + (mapc (lambda (target-direction) (put direction 'w0 (lm-f (+ @@ -1415,7 +1415,7 @@ After this limit is reached, lm-random-move is called to push him out of it." ;;;_ + Statistics gathering and creating functions (defun lm-calc-current-smells () - (mapc '(lambda (direction) + (mapc (lambda (direction) (put direction 'smell (calc-smell-internal direction))) lm-directions)) @@ -1427,7 +1427,7 @@ After this limit is reached, lm-random-move is called to push him out of it." (setf lm-no-payoff 0))) (defun lm-store-old-y_t () - (mapc '(lambda (direction) + (mapc (lambda (direction) (put direction 'y_t-1 (get direction 'y_t))) lm-directions)) @@ -1435,35 +1435,33 @@ After this limit is reached, lm-random-move is called to push him out of it." ;;;_ + Functions to move robot (defun lm-confidence-for (target-direction) - (+ - (get target-direction 'w0) - (reduce '+ - (mapcar '(lambda (direction) - (* - (get direction target-direction) - (get direction 'smell)) - ) - lm-directions)))) + (apply '+ + (get target-direction 'w0) + (mapcar (lambda (direction) + (* + (get direction target-direction) + (get direction 'smell))) + lm-directions))) (defun lm-calc-confidences () - (mapc '(lambda (direction) + (mapc (lambda (direction) (put direction 's (lm-confidence-for direction))) lm-directions)) (defun lm-move () (if (and (= (get 'lm-n 'y_t) 1.0) (= (get 'lm-s 'y_t) 1.0)) (progn - (mapc '(lambda (dir) (put dir 'y_t 0)) lm-ns) + (mapc (lambda (dir) (put dir 'y_t 0)) lm-ns) (if lm-debug (message "n-s normalization.")))) (if (and (= (get 'lm-w 'y_t) 1.0) (= (get 'lm-e 'y_t) 1.0)) (progn - (mapc '(lambda (dir) (put dir 'y_t 0)) lm-ew) + (mapc (lambda (dir) (put dir 'y_t 0)) lm-ew) (if lm-debug (message "e-w normalization")))) - (mapc '(lambda (pair) + (mapc (lambda (pair) (if (> (get (car pair) 'y_t) 0) (funcall (car (cdr pair))))) '( @@ -1479,7 +1477,7 @@ After this limit is reached, lm-random-move is called to push him out of it." (defun lm-random-move () (mapc - '(lambda (direction) (put direction 'y_t 0)) + (lambda (direction) (put direction 'y_t 0)) lm-directions) (dolist (direction (nth (random 8) lm-8-directions)) (put direction 'y_t 1.0)) @@ -1575,14 +1573,14 @@ If the game is finished, this command requests for another game." (lm-set-landmark-signal-strengths) - (mapc '(lambda (direction) + (mapc (lambda (direction) (put direction 'y_t 0.0)) lm-directions) (if (not save-weights) (progn (mapc 'lm-fix-weights-for lm-directions) - (mapc '(lambda (direction) + (mapc (lambda (direction) (put direction 'w0 lm-initial-w0)) lm-directions)) (message "Weights preserved for this run.")) @@ -1612,10 +1610,10 @@ If the game is finished, this command requests for another game." (setq lm-tree-r (* (sqrt (+ (square lm-cx) (square lm-cy))) 1.5)) - (mapc '(lambda (direction) + (mapc (lambda (direction) (put direction 'r (* lm-cx 1.1))) lm-ew) - (mapc '(lambda (direction) + (mapc (lambda (direction) (put direction 'r (* lm-cy 1.1))) lm-ns) (put 'lm-tree 'r lm-tree-r)) diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 432aa8e3852..315b61a8ab2 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -1367,8 +1367,8 @@ This function is more useful than \\[tex-buffer] when you need the (setq start (match-end 0))) (or (= start 0) (setq elts (cons (substring s start) elts))) - (mapconcat '(lambda (elt) - (if (= (length elt) 0) elt (expand-file-name elt))) + (mapconcat (lambda (elt) + (if (= (length elt) 0) elt (expand-file-name elt))) (nreverse elts) ":"))) (defun tex-shell-running () -- 2.11.4.GIT