1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-27 10:54:40 +00:00

(doctor-cadr, doctor-caddr, doctor-cddr): Remove.

Update callers.
This commit is contained in:
John Paul Wallington 2002-09-09 05:50:58 +00:00
parent ab9ecc746b
commit 454473ea06
2 changed files with 31 additions and 30 deletions

View 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.

View File

@ -45,10 +45,6 @@
;;; 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))))))))
@ -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)