Browse Source

Changes.

master
Silas Vedder 3 years ago
parent
commit
7b2d72eaf2
  1. 19
      cl-bible.lisp

19
cl-bible.lisp

@ -2,14 +2,18 @@
(in-package #:cl-bible) (in-package #:cl-bible)
(defvar *bible* '())
(defun init-bible (&optional (bible "mng")) (defun init-bible (&optional (bible "mng"))
(setf *bible* (setf *bible*
(mapcar #'string->verse (mapcar #'string->verse
(uiop:read-file-lines (uiop:read-file-lines
(format nil "resources/~A.tsv" bible))))) (format nil "resources/~A.tsv" bible)))))
(defvar *bible*)
(defvar *mng* (init-bible))
(defvar *vul* (init-bible "vul"))
(defvar *grb* (init-bible "grb"))
(defvar *kjv* (init-bible "kjv"))
(defun lift-search-window (body search) (defun lift-search-window (body search)
(lambda (obj) (lambda (obj)
(declare (ignore obj)) (declare (ignore obj))
@ -40,6 +44,13 @@
(lambda (phrase) (lambda (phrase)
(search-in-bible phrase window))))) (search-in-bible phrase window)))))
(defun update-bible (str)
(let ((bibles `(("mng" . ,*mng*)
("kjv" . ,*kjv*)
("vul" . ,*vul*)
("grb" . ,*grb*))))
(setf *bible* (cdr (assoc str bibles :test #'string=)))))
(defun reload (window) (defun reload (window)
(lambda (obj) (lambda (obj)
(declare (ignore obj)) (declare (ignore obj))
@ -49,8 +60,8 @@
("Vulgata" "vul") ("Vulgata" "vul")
("Greek Bible" "grb")))) ("Greek Bible" "grb"))))
(lambda (results) (lambda (results)
(init-bible (cadar results))) (update-bible (cadar results))
:title "Load a Bible"))) :title "Load a Bible"))))
(defun load-chapter (canvas) (defun load-chapter (canvas)
(lambda (data) (lambda (data)

Loading…
Cancel
Save