wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

LISP - Library Management System

profile
Fatima Shaikh
Jul 16, 2025
4 Likes
7 Discussions
6 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

Not anti-social, but pro-solitude

Blog banner

Title: Modern Operating Systems: Powering the Digital Era

Blog banner

Modern operating system

Blog banner

Why do you need a personalised bag tag for your kids' school bags?

Blog banner

A-B-C of Networking: Part-2 (Components)

Blog banner

POVERTY:Causes and solutions to problems

Blog banner

A Short History of GIS

Blog banner

Career v/s Job : Choose your passion

Blog banner

Protect yourself from System Hacking with these Simple Steps

Blog banner

Functions of operating system

Blog banner

The most common internet security threats

Blog banner

File system implementation

Blog banner

Evolution of operating system

Blog banner

Cycling

Blog banner

Data Science in Predictive Analytics: Transforming Business Decision-Making

Blog banner

The Rise of Polo Tourism in the USA: How Travellers Are Blending Luxury Stays with Elite Sports

Blog banner

Life

Blog banner

Deadlock and starvation in operating system

Blog banner

Teenagers of Today

Blog banner

FASHION

Blog banner

5 ways to save money on catering services in Mumbai

Blog banner

Exploring the Power of Encase Forensic Tools: Unraveling Digital Mysteries

Blog banner

Why Moms Are Choosing Customised School Accessories Over Generic Products?

Blog banner

Data Analytics in Data Science

Blog banner

Top 5 Places To Stay And Visit In Berlin, Germany

Blog banner

The Power of Cyber Forensic in Solving Crimes

Blog banner

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

Blog banner

Impacts of Data Breach On Companies Challenges and Prevention

Blog banner

Security issues

Blog banner

Personalised Name Labels vs. Handwritten Stickers: Which Is Better for Your Child’s School Essentials?

Blog banner

Zero Trust Security Model: Revolutionizing Cybersecurity in the Digital Age

Blog banner

DATA VAULT

Blog banner

MODERN OPERATING SYSTEM

Blog banner

What is OS Fingerprinting?

Blog banner

Android Flashlight Application

Blog banner

Review on Recovering Deleted Files

Blog banner

Characteristics of Etherum

Blog banner

GIS in Mapping and landslide alert in Bangladesh

Blog banner

LIMITED EDITION

Blog banner

26/11 The Black Day Of Mumbai

Blog banner

VIRTUAL MACHINES

Blog banner

Design Considerations for Disk Cache Management

Blog banner