]> git.eshelyaron.com Git - emacs.git/commitdiff
(doctor-cadr, doctor-caddr, doctor-cddr): Remove.
authorJohn Paul Wallington <jpw@pobox.com>
Mon, 9 Sep 2002 05:50:58 +0000 (05:50 +0000)
committerJohn Paul Wallington <jpw@pobox.com>
Mon, 9 Sep 2002 05:50:58 +0000 (05:50 +0000)
Update callers.

lisp/ChangeLog
lisp/play/doctor.el

index 84f27ce5eb66cd29174b46c4ef5962f6bdf116a4..4b37628a87036de3d135115e0eff6cb2068ad887 100644 (file)
@@ -1,3 +1,8 @@
+2002-09-09  John Paul Wallington  <jpw@shootybangbang.com>
+
+       * play/doctor.el (doctor-cadr, doctor-caddr, doctor-cddr): Remove.
+       Update callers.
+       
 2002-09-08  Markus Rost  <rost@math.ohio-state.edu>
 
        * diff.el (diff): Doc fix.
index 3eecfd2122c8a7661852dcae30d6a03876edcea3..2f7a5759a90e0d8f82c90091a37e909b528d2567 100644 (file)
 
 ;;; Code:
 
-(defun doctor-cadr (x) (car (cdr x)))
-(defun doctor-caddr (x) (car (cdr (cdr x))))
-(defun doctor-cddr (x) (cdr (cdr x)))
-
 (defun // (x) x)
 
 (defmacro $ (what)
@@ -91,8 +87,8 @@ reads the sentence before point, and prints the Doctor's answer."
   (make-local-variable 'typos)
   (setq typos
        (mapcar (function (lambda (x)
-                           (put (car x) 'doctor-correction  (doctor-cadr x))
-                           (put (doctor-cadr x) 'doctor-expansion (doctor-caddr x))
+                           (put (car x) 'doctor-correction  (cadr x))
+                           (put (cadr x) 'doctor-expansion (car (cddr x)))
                            (car x)))
                '((theyll they\'ll (they will))
                  (theyre they\'re (they are))
@@ -892,11 +888,11 @@ Otherwise call the Doctor to parse preceding sentence."
                    bye\, stop pause goodbye\, stop pause)))
     (doctor-type ($ bye)))
    ((and (eq (car sent) 'you)
-        (memq (doctor-cadr sent) abusewords))
-    (setq found (doctor-cadr sent))
+        (memq (cadr sent) abusewords))
+    (setq found (cadr sent))
     (doctor-type ($ abuselst)))
    ((eq (car sent) 'whatmeans)
-    (doctor-def (doctor-cadr sent)))
+    (doctor-def (cadr sent)))
    ((equal sent '(parse))
     (doctor-type (list  'subj '= subj ",  "
                        'verb '= verb "\n"
@@ -912,7 +908,7 @@ Otherwise call the Doctor to parse preceding sentence."
    ((memq (car sent) '(do has have how when where who why))
     (doctor-type ($ qlist)))
    ;;   ((eq (car sent) 'forget)
-   ;;    (set (doctor-cadr sent) nil)
+   ;;    (set (cadr sent) nil)
    ;;    (doctor-type '(($ isee)($ please)
    ;;     ($ continue)\.)))
    (t
@@ -931,7 +927,7 @@ Otherwise call the Doctor to parse preceding sentence."
           (if (memq 'am sent)
               (setq sent (doctor-replace sent '((me . (i))))))
           (setq sent (doctor-fixup sent))
-          (if (and (eq (car sent) 'do) (eq (doctor-cadr sent) 'not))
+          (if (and (eq (car sent) 'do) (eq (cadr sent) 'not))
               (cond ((zerop (random 3))
                      (doctor-type '(are you ($ afraidof) that \?)))
                     ((zerop (random 2))
@@ -940,7 +936,7 @@ Otherwise call the Doctor to parse preceding sentence."
                      (doctor-rthing))
                     (t
                      (doctor-type '(($ whysay) that i shouldn\'t
-                                    (doctor-cddr sent)
+                                    (cddr sent)
                                     \?))))
             (doctor-go (doctor-wherego sent))))))))
 \f
@@ -1138,13 +1134,13 @@ the subject noun, and return the portion of the sentence following it."
 (defun doctor-setprep (sent key)
   (let ((val)
        (foo (memq key sent)))
-    (cond ((doctor-prepp (doctor-cadr foo))
-          (setq val (doctor-getnoun (doctor-cddr foo)))
+    (cond ((doctor-prepp (cadr foo))
+          (setq val (doctor-getnoun (cddr foo)))
           (cond (val val)
                 (t 'something)))
-         ((doctor-articlep (doctor-cadr foo))
-          (setq val (doctor-getnoun (doctor-cddr foo)))
-          (cond (val (doctor-build (doctor-build (doctor-cadr foo) " ") val))
+         ((doctor-articlep (cadr foo))
+          (setq val (doctor-getnoun (cddr foo)))
+          (cond (val (doctor-build (doctor-build (cadr foo) " ") val))
                 (t 'something)))
          (t 'something))))
 
@@ -1275,33 +1271,33 @@ the subject noun, and return the portion of the sentence following it."
   (let ((foo sent))
     (while foo
       (if (and (eq (car foo) 'me)
-              (doctor-verbp (doctor-cadr foo)))
+              (doctor-verbp (cadr foo)))
          (rplaca foo 'i)
        (cond ((eq (car foo) 'you)
-              (cond ((memq (doctor-cadr foo) '(am be been is))
+              (cond ((memq (cadr foo) '(am be been is))
                      (rplaca (cdr foo) 'are))
-                    ((memq (doctor-cadr foo) '(has))
+                    ((memq (cadr foo) '(has))
                      (rplaca (cdr foo) 'have))
-                    ((memq (doctor-cadr foo) '(was))
+                    ((memq (cadr foo) '(was))
                      (rplaca (cdr foo) 'were))))
              ((equal (car foo) 'i)
-              (cond ((memq (doctor-cadr foo) '(are is be been))
+              (cond ((memq (cadr foo) '(are is be been))
                      (rplaca (cdr foo) 'am))
-                    ((memq (doctor-cadr foo) '(were))
+                    ((memq (cadr foo) '(were))
                      (rplaca (cdr foo) 'was))
-                    ((memq (doctor-cadr foo) '(has))
+                    ((memq (cadr foo) '(has))
                      (rplaca (cdr foo) 'have))))
              ((and (doctor-verbp (car foo))
-                   (eq (doctor-cadr foo) 'i)
-                   (not (doctor-verbp (car (doctor-cddr foo)))))
+                   (eq (cadr foo) 'i)
+                   (not (doctor-verbp (car (cddr foo)))))
               (rplaca (cdr foo) 'me))
              ((and (eq (car foo) 'a)
                    (doctor-vowelp (string-to-char
-                                   (doctor-make-string (doctor-cadr foo)))))
+                                   (doctor-make-string (cadr foo)))))
               (rplaca foo 'an))
              ((and (eq (car foo) 'an)
                    (not (doctor-vowelp (string-to-char
-                                        (doctor-make-string (doctor-cadr foo))))))
+                                        (doctor-make-string (cadr foo))))))
               (rplaca foo 'a)))
        (setq foo (cdr foo))))
     sent))
@@ -1494,12 +1490,12 @@ Hack on previous word, setting global variable OWNER to correct result."
   (let ((foo (memq found sent)))
     (cond ((< (length foo) 2)
           (doctor-go (doctor-build (doctor-meaning found) 1)))
-         ((memq (doctor-cadr foo) '(a an))
+         ((memq (cadr foo) '(a an))
           (rplacd foo (append '(to have) (cdr foo)))
           (doctor-svo sent found 1 nil)
           (doctor-remember (list subj 'would 'like obj))
           (doctor-type ($ whywant)))
-         ((not (eq (doctor-cadr foo) 'to))
+         ((not (eq (cadr foo) 'to))
           (doctor-go (doctor-build (doctor-meaning found) 1)))
          (t
           (doctor-svo sent found 1 nil)