wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

LISP - Library Management System

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

How To Setup DVWA Using XAMPP on Windows

Blog banner

How Laughing Gas Makes Your Dental Visit So Much Easier

Blog banner

Types of Threads

Blog banner

Digital Forensics Challenges and Tools

Blog banner

Sessions In OS.

Blog banner

note taker app

Blog banner

Virtual Memory

Blog banner

Understanding Regression Analysis

Blog banner

Different Types of Data

Blog banner

M commerce

Blog banner

How to kiss

Blog banner

Design Considerations for Disk Cache Management

Blog banner

Smart Shoephone: Is that technology overdose!?

Blog banner

Analysis of Digital Evidence In Identity Theft Investigations

Blog banner

Benefits and drawback of web security.

Blog banner

Deadlock

Blog banner

Microsoft Word

Blog banner

Virtual Memory - Explaination, Working, Steps

Blog banner

Assignment-3

Blog banner

The seven-step improvement process

Blog banner

Impacts of Data Breach On Companies Challenges and Prevention

Blog banner

Deadlock and Starvation

Blog banner

Starvation

Blog banner

Os Virtual Memory

Blog banner

Man In The Middle Attack

Blog banner

Microsoft powerpoint presentation

Blog banner

Health and fitness

Blog banner

How to Grow Your Brand on YouTube Without a Big Budget

Blog banner

What is a Dumpster Diving Attack?

Blog banner

SQL Injection

Blog banner

BharatPe

Blog banner

GUIDE TO GIS

Blog banner

What is Virtual Memory

Blog banner

Real Time Scheduling

Blog banner

DATA VAULT

Blog banner

Evolution of operating systems

Blog banner

Financial Stress and Mental Health

Blog banner

10 Types of Friends in every friend group

Blog banner

A-B-C of Networking: Part-1 (Basics)

Blog banner

Optimization of operating system design

Blog banner

Virtual Memory

Blog banner

Deadlock in operating system

Blog banner