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

DMZ: Your Secret Weapon for Data Security

Blog banner

NETWORK SECURITY RISKS

Blog banner

Electronic Evidence in Cyber Forensics

Blog banner

Why is it hard to design an Operating Systems ?

Blog banner

How to Avoid being a Victim of Cybercrime

Blog banner

Service design process in ITSM

Blog banner

Throttle engine ’Sneak peek into the future’

Blog banner

Deadlock

Blog banner

Cache Memory

Blog banner

10 Reasons to date your best friend

Blog banner

File Systems in OS.

Blog banner

How to use GIT & GITHUB

Blog banner

Types Of Interrupt

Blog banner

IT Service Continuity Management

Blog banner

Importance of Education

Blog banner

What is OS and its overview

Blog banner

Synchronization

Blog banner

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

Blog banner

How Reading Books Shape a Child’s Imagination and Thinking?

Blog banner

AN EVENT-BASED DIGITAL FORENSIC INVESTIGATION

Blog banner

15 Interesting Facts about India

Blog banner

Virtual Machine's

Blog banner

Docker Framework

Blog banner

Efficiency of SQL Injection Method in Preventing E-Mail Hacking

Blog banner

Introduction to Data Science: Life Cycle & Applications

Blog banner

Therapy Myths That Need to End in 2025

Blog banner

The Five Steps of Data Science

Blog banner

Cloud Computing

Blog banner

Memory heirachy (Operating system)

Blog banner

The Everyday Parenting Dilemma: Safety Vs Independence

Blog banner

Hosting basics

Blog banner

Dudhasagar waterfall ?

Blog banner

Race Condition in Operating Theatre

Blog banner

operating system

Blog banner

Record Blocking

Blog banner

Khau Galli – Vile Parle

Blog banner

Deadlock in operating system

Blog banner

What Your Music Taste Reveals About Your Personality

Blog banner

Mumbai

Blog banner

Technological Advancement

Blog banner

Threads

Blog banner

RAID_142

Blog banner