aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Paul Wallington2002-09-09 05:50:58 +0000
committerJohn Paul Wallington2002-09-09 05:50:58 +0000
commit454473ea06fa67a5d4f8c9469f403bfa39706c54 (patch)
tree79bf8ded45ce1a59e2f5ba7d092e515337f7810f
parentab9ecc746ba0332172ef5b06dee69b1210f37b0e (diff)
downloademacs-454473ea06fa67a5d4f8c9469f403bfa39706c54.tar.gz
emacs-454473ea06fa67a5d4f8c9469f403bfa39706c54.zip
(doctor-cadr, doctor-caddr, doctor-cddr): Remove.
Update callers.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/play/doctor.el56
2 files changed, 31 insertions, 30 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 84f27ce5eb6..4b37628a870 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12002-09-09 John Paul Wallington <jpw@shootybangbang.com>
2
3 * play/doctor.el (doctor-cadr, doctor-caddr, doctor-cddr): Remove.
4 Update callers.
5
12002-09-08 Markus Rost <rost@math.ohio-state.edu> 62002-09-08 Markus Rost <rost@math.ohio-state.edu>
2 7
3 * diff.el (diff): Doc fix. 8 * diff.el (diff): Doc fix.
diff --git a/lisp/play/doctor.el b/lisp/play/doctor.el
index 3eecfd2122c..2f7a5759a90 100644
--- a/lisp/play/doctor.el
+++ b/lisp/play/doctor.el
@@ -45,10 +45,6 @@
45 45
46;;; Code: 46;;; Code:
47 47
48(defun doctor-cadr (x) (car (cdr x)))
49(defun doctor-caddr (x) (car (cdr (cdr x))))
50(defun doctor-cddr (x) (cdr (cdr x)))
51
52(defun // (x) x) 48(defun // (x) x)
53 49
54(defmacro $ (what) 50(defmacro $ (what)
@@ -91,8 +87,8 @@ reads the sentence before point, and prints the Doctor's answer."
91 (make-local-variable 'typos) 87 (make-local-variable 'typos)
92 (setq typos 88 (setq typos
93 (mapcar (function (lambda (x) 89 (mapcar (function (lambda (x)
94 (put (car x) 'doctor-correction (doctor-cadr x)) 90 (put (car x) 'doctor-correction (cadr x))
95 (put (doctor-cadr x) 'doctor-expansion (doctor-caddr x)) 91 (put (cadr x) 'doctor-expansion (car (cddr x)))
96 (car x))) 92 (car x)))
97 '((theyll they\'ll (they will)) 93 '((theyll they\'ll (they will))
98 (theyre they\'re (they are)) 94 (theyre they\'re (they are))
@@ -892,11 +888,11 @@ Otherwise call the Doctor to parse preceding sentence."
892 bye\, stop pause goodbye\, stop pause))) 888 bye\, stop pause goodbye\, stop pause)))
893 (doctor-type ($ bye))) 889 (doctor-type ($ bye)))
894 ((and (eq (car sent) 'you) 890 ((and (eq (car sent) 'you)
895 (memq (doctor-cadr sent) abusewords)) 891 (memq (cadr sent) abusewords))
896 (setq found (doctor-cadr sent)) 892 (setq found (cadr sent))
897 (doctor-type ($ abuselst))) 893 (doctor-type ($ abuselst)))
898 ((eq (car sent) 'whatmeans) 894 ((eq (car sent) 'whatmeans)
899 (doctor-def (doctor-cadr sent))) 895 (doctor-def (cadr sent)))
900 ((equal sent '(parse)) 896 ((equal sent '(parse))
901 (doctor-type (list 'subj '= subj ", " 897 (doctor-type (list 'subj '= subj ", "
902 'verb '= verb "\n" 898 'verb '= verb "\n"
@@ -912,7 +908,7 @@ Otherwise call the Doctor to parse preceding sentence."
912 ((memq (car sent) '(do has have how when where who why)) 908 ((memq (car sent) '(do has have how when where who why))
913 (doctor-type ($ qlist))) 909 (doctor-type ($ qlist)))
914 ;; ((eq (car sent) 'forget) 910 ;; ((eq (car sent) 'forget)
915 ;; (set (doctor-cadr sent) nil) 911 ;; (set (cadr sent) nil)
916 ;; (doctor-type '(($ isee)($ please) 912 ;; (doctor-type '(($ isee)($ please)
917 ;; ($ continue)\.))) 913 ;; ($ continue)\.)))
918 (t 914 (t
@@ -931,7 +927,7 @@ Otherwise call the Doctor to parse preceding sentence."
931 (if (memq 'am sent) 927 (if (memq 'am sent)
932 (setq sent (doctor-replace sent '((me . (i)))))) 928 (setq sent (doctor-replace sent '((me . (i))))))
933 (setq sent (doctor-fixup sent)) 929 (setq sent (doctor-fixup sent))
934 (if (and (eq (car sent) 'do) (eq (doctor-cadr sent) 'not)) 930 (if (and (eq (car sent) 'do) (eq (cadr sent) 'not))
935 (cond ((zerop (random 3)) 931 (cond ((zerop (random 3))
936 (doctor-type '(are you ($ afraidof) that \?))) 932 (doctor-type '(are you ($ afraidof) that \?)))
937 ((zerop (random 2)) 933 ((zerop (random 2))
@@ -940,7 +936,7 @@ Otherwise call the Doctor to parse preceding sentence."
940 (doctor-rthing)) 936 (doctor-rthing))
941 (t 937 (t
942 (doctor-type '(($ whysay) that i shouldn\'t 938 (doctor-type '(($ whysay) that i shouldn\'t
943 (doctor-cddr sent) 939 (cddr sent)
944 \?)))) 940 \?))))
945 (doctor-go (doctor-wherego sent)))))))) 941 (doctor-go (doctor-wherego sent))))))))
946 942
@@ -1138,13 +1134,13 @@ the subject noun, and return the portion of the sentence following it."
1138(defun doctor-setprep (sent key) 1134(defun doctor-setprep (sent key)
1139 (let ((val) 1135 (let ((val)
1140 (foo (memq key sent))) 1136 (foo (memq key sent)))
1141 (cond ((doctor-prepp (doctor-cadr foo)) 1137 (cond ((doctor-prepp (cadr foo))
1142 (setq val (doctor-getnoun (doctor-cddr foo))) 1138 (setq val (doctor-getnoun (cddr foo)))
1143 (cond (val val) 1139 (cond (val val)
1144 (t 'something))) 1140 (t 'something)))
1145 ((doctor-articlep (doctor-cadr foo)) 1141 ((doctor-articlep (cadr foo))
1146 (setq val (doctor-getnoun (doctor-cddr foo))) 1142 (setq val (doctor-getnoun (cddr foo)))
1147 (cond (val (doctor-build (doctor-build (doctor-cadr foo) " ") val)) 1143 (cond (val (doctor-build (doctor-build (cadr foo) " ") val))
1148 (t 'something))) 1144 (t 'something)))
1149 (t 'something)))) 1145 (t 'something))))
1150 1146
@@ -1275,33 +1271,33 @@ the subject noun, and return the portion of the sentence following it."
1275 (let ((foo sent)) 1271 (let ((foo sent))
1276 (while foo 1272 (while foo
1277 (if (and (eq (car foo) 'me) 1273 (if (and (eq (car foo) 'me)
1278 (doctor-verbp (doctor-cadr foo))) 1274 (doctor-verbp (cadr foo)))
1279 (rplaca foo 'i) 1275 (rplaca foo 'i)
1280 (cond ((eq (car foo) 'you) 1276 (cond ((eq (car foo) 'you)
1281 (cond ((memq (doctor-cadr foo) '(am be been is)) 1277 (cond ((memq (cadr foo) '(am be been is))
1282 (rplaca (cdr foo) 'are)) 1278 (rplaca (cdr foo) 'are))
1283 ((memq (doctor-cadr foo) '(has)) 1279 ((memq (cadr foo) '(has))
1284 (rplaca (cdr foo) 'have)) 1280 (rplaca (cdr foo) 'have))
1285 ((memq (doctor-cadr foo) '(was)) 1281 ((memq (cadr foo) '(was))
1286 (rplaca (cdr foo) 'were)))) 1282 (rplaca (cdr foo) 'were))))
1287 ((equal (car foo) 'i) 1283 ((equal (car foo) 'i)
1288 (cond ((memq (doctor-cadr foo) '(are is be been)) 1284 (cond ((memq (cadr foo) '(are is be been))
1289 (rplaca (cdr foo) 'am)) 1285 (rplaca (cdr foo) 'am))
1290 ((memq (doctor-cadr foo) '(were)) 1286 ((memq (cadr foo) '(were))
1291 (rplaca (cdr foo) 'was)) 1287 (rplaca (cdr foo) 'was))
1292 ((memq (doctor-cadr foo) '(has)) 1288 ((memq (cadr foo) '(has))
1293 (rplaca (cdr foo) 'have)))) 1289 (rplaca (cdr foo) 'have))))
1294 ((and (doctor-verbp (car foo)) 1290 ((and (doctor-verbp (car foo))
1295 (eq (doctor-cadr foo) 'i) 1291 (eq (cadr foo) 'i)
1296 (not (doctor-verbp (car (doctor-cddr foo))))) 1292 (not (doctor-verbp (car (cddr foo)))))
1297 (rplaca (cdr foo) 'me)) 1293 (rplaca (cdr foo) 'me))
1298 ((and (eq (car foo) 'a) 1294 ((and (eq (car foo) 'a)
1299 (doctor-vowelp (string-to-char 1295 (doctor-vowelp (string-to-char
1300 (doctor-make-string (doctor-cadr foo))))) 1296 (doctor-make-string (cadr foo)))))
1301 (rplaca foo 'an)) 1297 (rplaca foo 'an))
1302 ((and (eq (car foo) 'an) 1298 ((and (eq (car foo) 'an)
1303 (not (doctor-vowelp (string-to-char 1299 (not (doctor-vowelp (string-to-char
1304 (doctor-make-string (doctor-cadr foo)))))) 1300 (doctor-make-string (cadr foo))))))
1305 (rplaca foo 'a))) 1301 (rplaca foo 'a)))
1306 (setq foo (cdr foo)))) 1302 (setq foo (cdr foo))))
1307 sent)) 1303 sent))
@@ -1494,12 +1490,12 @@ Hack on previous word, setting global variable OWNER to correct result."
1494 (let ((foo (memq found sent))) 1490 (let ((foo (memq found sent)))
1495 (cond ((< (length foo) 2) 1491 (cond ((< (length foo) 2)
1496 (doctor-go (doctor-build (doctor-meaning found) 1))) 1492 (doctor-go (doctor-build (doctor-meaning found) 1)))
1497 ((memq (doctor-cadr foo) '(a an)) 1493 ((memq (cadr foo) '(a an))
1498 (rplacd foo (append '(to have) (cdr foo))) 1494 (rplacd foo (append '(to have) (cdr foo)))
1499 (doctor-svo sent found 1 nil) 1495 (doctor-svo sent found 1 nil)
1500 (doctor-remember (list subj 'would 'like obj)) 1496 (doctor-remember (list subj 'would 'like obj))
1501 (doctor-type ($ whywant))) 1497 (doctor-type ($ whywant)))
1502 ((not (eq (doctor-cadr foo) 'to)) 1498 ((not (eq (cadr foo) 'to))
1503 (doctor-go (doctor-build (doctor-meaning found) 1))) 1499 (doctor-go (doctor-build (doctor-meaning found) 1)))
1504 (t 1500 (t
1505 (doctor-svo sent found 1 nil) 1501 (doctor-svo sent found 1 nil)