Innokenty Enikeev пре 10 година
родитељ
комит
7b61a0ccce
2 измењених фајлова са 4 додато и 8 уклоњено
  1. 1 3
      chatikbot.lisp
  2. 3 5
      eliza.lisp

+ 1 - 3
chatikbot.lisp

@@ -505,7 +505,5 @@
                             :thread t))
   ;; Start getUpdates thread
   (bordeaux-threads:make-thread
-   (lambda ()
-     (in-package #:chatikbot)
-     (loop-with-error-backoff #'process-updates))
+   (lambda () (loop-with-error-backoff #'process-updates))
    :name "process-updates"))

+ 3 - 5
eliza.lisp

@@ -59,11 +59,9 @@
 
 (defun read-from-string-no-punct (input)
   "Read from an input string, ignoring punctuation."
-  (read-from-string
-   (concatenate 'string
-                "("
-                (substitute-if #\space #'punctuation-p input)
-                ")")))
+  (let ((*package* (find-package 'chatikbot)))
+    (read-from-string
+     (concatenate 'string "(" (substitute-if #\space #'punctuation-p input) ")"))))
 
 (defun print-with-spaces (list)
   (format nil "~@(~{~a~^ ~}~)" list))