wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

LISP - Library Management System

profile
Fatima Shaikh
Jul 16, 2025
4 Likes
7 Discussions
3 Reads

;; Simple Library Management System


;; Global variable to store books

(defvar *library* nil)


;; Function to add a book

(defun add-book (title author)

(push (list title author 'available) *library*)

(format t "~%Added: ~A by ~A" title author))


;; Function to display all books

(defun show-books ()

(format t "~%Library Contents:")

(dolist (book *library*)

(format t "~%Title: ~A, Author: ~A, Status: ~A"

(first book)

(second book)

(third book))))


;; Function to checkout a book

(defun checkout (title)

(let ((book (find title *library* :key #'first :test #'equal)))

(if book

(progn

(setf (third book) 'checked-out)

(format t "~%Checked out: ~A" title))

(format t "~%Book not found: ~A" title))))


;; Test the system

(defun test-library ()

(format t "~%=== Testing Library System ===")

;; Add some books

(add-book "The God of Small Things" "Arundhati Roy")

(add-book "Midnight's Children" "Salman Rushdie")

;; Show all books

(show-books)

;; Checkout a book

(checkout "The Hobbit")

(checkout "Midnight's Children")

;; Show updated library

(show-books))


;; Run the test

(test-library)



Output:



Comments ()


Sign in

Read Next

DIGITAL ECONOMY

Blog banner

OS- Assignnment 1

Blog banner

Process, process creation and process termination

Blog banner

The House ??of Patola Designs: Traditional Weaves with a Modern Twist

Blog banner

Measuring IT Risk

Blog banner

Paralysis/Paralysis Stroke

Blog banner

How to make Pancakes

Blog banner

Excel records

Blog banner

Getting into anime My anime suggestions

Blog banner

Interrupts in operating system.

Blog banner

Advantage of freedom

Blog banner

Travel: Everything Everywhere!

Blog banner

PODIO

Blog banner

INSTAGRAM

Blog banner

Deadlock

Blog banner

Direct memory access

Blog banner

How to tie a Tie

Blog banner

Utilizing Data-Hiding and Retrieval Techniques in Cyber Forensics

Blog banner

Philadelphia Experiment : Was it real?

Blog banner

File Allocation Methods

Blog banner

Data Visualization- Importance and tools (Tableau,Power BI, Matplotlib)

Blog banner

MAJOR ACHIEVEMENTS OF OS

Blog banner

Lemon and Chilli Pickle (Limbu Mirchi Achar)

Blog banner

Image Steganalysis in Digital Forensics

Blog banner

The Right way of cooking

Blog banner

PHISHING

Blog banner

Deadlock

Blog banner

Modern Teaching Methods: Why Inquiry-based & Experiential Learning Works Best

Blog banner

Platonic Solids

Blog banner

EVOLUTION OF THE MIRCOPROCESSOR

Blog banner

Gis in agriculture and farming

Blog banner

Ethical Hacking

Blog banner

Scheduling

Blog banner

Multicore CPUs

Blog banner

Image Steganography: Hiding Secrets in Plain Sight

Blog banner

Building a Better You: Fitness Tips and Inspiration.

Blog banner

Starting Android Activity Using Intent

Blog banner

Types of Big Data

Blog banner

Why You Should Not Use Free VPNs

Blog banner

AI & Data Science in Healthcare – Predicting diseases, medical imaging analysis

Blog banner

File sharing

Blog banner

RSA (Rivest-Shamir-Adelman) Algorithm

Blog banner