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

Nature’s Brush on Silk: The Secret Behind Patola Colours

Blog banner

Data Analytics in Data Science

Blog banner

Footprinting

Blog banner

How to Manage Employees and Tasks in One System (Without Excel)

Blog banner

Constrained Management in IT

Blog banner

MYNTRA

Blog banner

How to invest in Indian Stock Market ? ~ Tutorial 1

Blog banner

A Day in the Life at Elzee: What Your Child Does Between Drop-Off and Pick-Up

Blog banner

CoWIN

Blog banner

ITIL Version 3 and 4 differenciation?

Blog banner

Vulnerabilities in OnePlus Devices

Blog banner

Hypothesis Testing in Data Science

Blog banner

A BLOG ON MYSQL

Blog banner

Memory Management of Operating System(OS)

Blog banner

Virtual memory

Blog banner

Semaphores

Blog banner

Why Soft Skills Matter as Much as Grades?

Blog banner

Risk factors in service transistion

Blog banner

Maharashtrian culture: Tradition, Art, Food

Blog banner

OS Assignment 3

Blog banner

Uniprocessor Scheduling

Blog banner

MailChimp

Blog banner

Understanding Univariate, Bivariate, and Multivariate Analysis in Data Science

Blog banner

CSI and Organizational Change

Blog banner

The role of artificial intelligence in automating digital forensic analysis.

Blog banner

Operating system evolution

Blog banner

Spitting Pink in the Sink: Why Your Gums Randomly Bleed

Blog banner

What is time ? The term which has astonished Scientists

Blog banner

The Difference Between Plaque and Tartar Explained Simply

Blog banner

Cache memory

Blog banner

Should you be using a mouthwash? Know from the experts

Blog banner

differentiate thinking humanly and rationally

Blog banner

Virtual Memory

Blog banner

Vulnerability Assessment (Vulnerability Analysis)

Blog banner

Security in Operating Systems

Blog banner

Operating System

Blog banner

IP ADDRESS

Blog banner

Modern operating system

Blog banner

Web browser forensics:Tools,Evidence collection and analysis

Blog banner

INTERNET

Blog banner

Cache memory

Blog banner

Why is online marketing is important in current scenario

Blog banner