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

What is process

Blog banner

Excel records

Blog banner

Stop Racism

Blog banner

SMARTSHEET MANAGEMENT SOFTWARE

Blog banner

First-Order Logic (FOL): The Foundation of Modern Logic

Blog banner

Security issues in Sensor Networks and gathering admissible evidence in Network Forensics

Blog banner

Strengthening Active Directory Security

Blog banner

Interrupts in OS

Blog banner

Assignment 2

Blog banner

City2Surf & Spring Fitness Recovery Guide: How Sports Drinks Silently Damage Enamel

Blog banner

DURGA POOJA

Blog banner

Pioneer Park Zolfo Springs — A Hidden Gem for Nature Lovers Near Arcadia

Blog banner

Palm Vein Biometric Technology; Contactless vein authentication

Blog banner

CYBER FORENCIS: PAST, PRESENT AND FUTURE.

Blog banner

Process State

Blog banner

Retiring ISS

Blog banner

How Cyber Forensics use in AI

Blog banner

Number Guessing game --lisp

Blog banner

Best password managers: Reviews of the top products

Blog banner

Deadlock

Blog banner

Data Visualization

Blog banner

Artificial Intelligence and I

Blog banner

Therapy Myths That Need to End in 2025

Blog banner

Mutual exclusion

Blog banner

How Cyber Forensics help prevent Crimes

Blog banner

WHAT IS TWITTER AND HOW DOES IT WORK

Blog banner

Deadlock

Blog banner

Celebrate Diwali the Delicious Way with Meal Maharaj Catering

Blog banner

Dal Bafla Recipe

Blog banner

Memory Management

Blog banner

Why Inconel 625 and Monel 400 Remain Unbeatable in Refinery Applications?

Blog banner

Wiretapping

Blog banner

What is the point of living if we can die at any moment of our lives ?

Blog banner

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

Blog banner

15 Websites that will make your life easier ...!!!

Blog banner

Short note on expert system

Blog banner

How Unstructured Play Helps Children Become Creative Thinkers

Blog banner

Charcoal, Lemon, and DIY Kits: Which “Viral” Dental Trends Are Actually Dangerous?

Blog banner

Message Passing in OS

Blog banner

?What Children Learn Between Activities: The Hidden Learning Moments in a Preschool Day

Blog banner

I/O Buffering

Blog banner

ADIDAS

Blog banner