wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

LISP - Library Management System

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

Virtual machine

Blog banner

Starvation

Blog banner

Deadlock and Starvation

Blog banner

Apache Kafka

Blog banner

Cloud Computing: Threats and Vulnerabilities

Blog banner

FRIENDSHIP

Blog banner

File management In Operating System

Blog banner

Ola

Blog banner

Disk Scheduling

Blog banner

File management in os

Blog banner

SMARTSHEET MANAGEMENT SYSTEM

Blog banner

Strengthening Active Directory Security

Blog banner

Layers Of Blockchain

Blog banner

Landslide Hazard

Blog banner

Health and fitness

Blog banner

Cyber Forensics

Blog banner

Is Pursuing a Dance Career in India Worth it?

Blog banner

What is a geographic information system (GIS)?

Blog banner

Evolution of the Microprocesor

Blog banner

Deadlock

Blog banner

RAID_142

Blog banner

Memory Hierarchy

Blog banner

Why Progressive Web Apps (PWAs) Are Replacing Traditional Websites

Blog banner

Theads

Blog banner

Wrike

Blog banner

Uniprocessor Scheduling

Blog banner

Bots and Cyber Security

Blog banner

Cryptanalysis tool

Blog banner

Data Visualization – Importance and tools (Tableau, Power BI)

Blog banner

PERSONAL STORIES

Blog banner

5 Stages of Digital Marketing

Blog banner

Data Security must be your Priority!

Blog banner

BUFFER OVERFLOW_142

Blog banner

Threading

Blog banner

VIRTUAL MACHINES

Blog banner

Virtual memory in os

Blog banner

In the world of Technology...

Blog banner

Microsoft powerpoint presentation

Blog banner

The Art of Slow Fashion: Why Patola Defines Sustainable Luxury

Blog banner

MOVEMBER

Blog banner

Security issues

Blog banner

Modern Operating System - Khush Bagaria

Blog banner