wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

LISP - Library Management System

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

E-security systems | CCTV

Blog banner

Direct Memory Access

Blog banner

evolution of operating system - Disha Parekh

Blog banner

Social Media Marketing Trends 2022

Blog banner

Electronic Funds Transfer

Blog banner

How to lose belly fat

Blog banner

Smart Homes | Zigbee Alliance

Blog banner

Routers

Blog banner

This too shall pass

Blog banner

Deadlock

Blog banner

memory managment

Blog banner

A-B-C of Networking: Part-3 (Topology [Bus & Star])

Blog banner

"The Benefits of Using GIS in Agriculture"

Blog banner

How covid-19 impacted Social media ad spend forecast globally

Blog banner

How To Secure Operating Systems ?

Blog banner

Software

Blog banner

Direct memory access (DMA)

Blog banner

Quality check in IT services

Blog banner

Memory Partitioning

Blog banner

MACHINE LEARNING

Blog banner

WHAT IS TWITTER AND HOW DOES IT WORK

Blog banner

What is Email? Uses of Emails

Blog banner

COMMUNICATION

Blog banner

differentiate thinking humanly and rationally

Blog banner

Deadlock

Blog banner

A-B-C of Networking: Part-3 (Topology [Ring, Tree, Mesh])

Blog banner

Love is in air.....

Blog banner

"Audit" In Data Science

Blog banner

I/O Management and Disk Scheduling

Blog banner

The functions of operating system

Blog banner

Data Visualization

Blog banner

Be you

Blog banner

SQL Injection practice on DVWA

Blog banner

PPT methodology

Blog banner

Mobile Survey

Blog banner

Yahoo! mail

Blog banner

Tracking Emails & Email Crimes

Blog banner

IT service level agreement

Blog banner

Are Social Media Paid Campaigns Worth It?

Blog banner

Raid and levels of raid.

Blog banner

Why Should You Schedule Tweets on Twitter?

Blog banner

All you need to know about Cassandra

Blog banner