wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

LISP - Library Management System

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

Survey of Which Movies Types people are Prefer to Watch in India.

Blog banner

Social engineering in cyber security

Blog banner

Linux 94

Blog banner

Embaded operating system

Blog banner

Paralysis/Paralysis Stroke

Blog banner

Scheduling

Blog banner

Phishing

Blog banner

ADD A SPICE TO YOUR LIFE.

Blog banner

Why Skipping Afternoon Meals Affects More Than Just Your Hunger?

Blog banner

FILE SHARING

Blog banner

Digital Footprints An Emerging Dimension of Digital Inequality

Blog banner

Types of OS

Blog banner

Virtual Machine

Blog banner

Social Media Sentiment Analysis

Blog banner

Modern Operating System

Blog banner

Service Strategy In ITSM

Blog banner

MoSCoW METHOD IN DATA SCIENCE

Blog banner

Answer

Blog banner

THE INPACT OF SOCIAL MEDIA!

Blog banner

Process Description

Blog banner

differentiate thinking humanly and rationally

Blog banner

Deadlock and Starvation

Blog banner

From Classic to Flavoured: Exploring Different Types of Khari

Blog banner

DEVELOPMENTS LEADING TO MODERN OPERATING SYSTEMS

Blog banner

Benefits of Yoga

Blog banner

What is Anxiety? How to manage Anxiety?

Blog banner

It's all about our Brain.- The Brain Metaphor

Blog banner

Why Meal Maharaj Prioritises Seasonal Vegetables in Every Meal Box

Blog banner

operating system

Blog banner

My Favorite Country

Blog banner

The Dark Web: A Breeding Ground for Cybercriminals – How to Guard Against Threats

Blog banner

Evolution of Operating system

Blog banner

Interrupts in operating system.

Blog banner

SMARTSHEET MANAGEMENT SOFTWARE

Blog banner

An Approach To Spyware Detection And Removal

Blog banner

Exploring Human Factors in Cyber Forensics Investigations.

Blog banner

Google classroom

Blog banner

Bit Coins

Blog banner

Deadlocks

Blog banner

AI and cyber Security

Blog banner

Brilliant WhatsApp Features Upcoming in 2023

Blog banner

Impacts of Data Breach On Companies Challenges and Prevention

Blog banner