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

"Life as a Part-time Student"

Blog banner

Method of Evaluating Information Security Level in an Organization

Blog banner

What Your Child Learns During Free Play (That You Might Not Notice)

Blog banner

Juveniles, Internet and Computer Crime

Blog banner

Game Theory in Blockchain

Blog banner

The Chapped Lips and Dry Mouth Trap: The Sneaky Reason Cavities Spike in Winter

Blog banner

Uniprocessor scheduling

Blog banner

Disk Scheduling

Blog banner

Virtual memory

Blog banner

Is Your Password Complex Enough?

Blog banner

Celebrate Diwali the Delicious Way with Meal Maharaj Catering

Blog banner

Mental Health

Blog banner

Human Error: The weakest link in Cybersecurity

Blog banner

Data Mining

Blog banner

OS Assignment 3

Blog banner

Importance of internet

Blog banner

Global versus Indian Mental Health Differences

Blog banner

Threads Concurrency: Mutual Exclusion and Synchronization

Blog banner

Anomaly Detection in Behavioral Data Using Machine Learning

Blog banner

The Role of Summer Camps in Early Childhood Development

Blog banner

An Approach To Spyware Detection And Removal

Blog banner

Benefits of Yoga

Blog banner

Health and fitness

Blog banner

Can ChatGPT Answer All My Questions About Life?

Blog banner

FRIENDSHIP

Blog banner

Service Transition Process in ITSM

Blog banner

Message Passing in OS

Blog banner

Technical Challenges and Directions for Digital Forensics

Blog banner

Virtual memory

Blog banner

Kafka - A Framework

Blog banner

Operating System

Blog banner

Expressing and Measuring Risk (Risk Management)

Blog banner

Getting into Anime

Blog banner

Deadlock

Blog banner

IT Service Continuity Management

Blog banner

Deadlock

Blog banner

virtual memory

Blog banner

Cyber Forensics on IOT Devices

Blog banner

How International Schools Build Global-Minded Students through Curriculum & Activities

Blog banner

LINUX

Blog banner

Article on Fresh Book

Blog banner

IT security management

Blog banner