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

Starvation

Blog banner

Benefits of yoga and meditation

Blog banner

Bit Coins

Blog banner

Process states

Blog banner

Mendeley (management software)

Blog banner

Subnet Masking

Blog banner

Gamer life

Blog banner

A True Friendship

Blog banner

DIGITAL TECHNOLOGY

Blog banner

MAILFENCE

Blog banner

From Airboat Tours to Fossil Hunting: The Ultimate Arcadia Travel Experience

Blog banner

Memory Management of Operating System(OS)

Blog banner

Dove’s Real Beauty Campaign- Case Study

Blog banner

Evolution of OS

Blog banner

A Traveller’s Guide to Offbeat Places in Arcadia, Florida

Blog banner

DATA BREACH CAUSES CHALLENGES PREVENTION AND FUTURE DIRECTIONS

Blog banner

File management

Blog banner

Human Error: The weakest link in Cybersecurity

Blog banner

Cyber Crime Investigation In The Era Of Big Data

Blog banner

Embedded Operating System

Blog banner

american greatines

Blog banner

Safe Learning Spaces: Why Preschool Environment Matters More Than Ever Today

Blog banner

PPC Advertising and its Impressive Benefits

Blog banner

Fault tolerance

Blog banner

Why Seasonal Summer Foods Are Best for Your Health?

Blog banner

Ethical Hacking

Blog banner

BENIFITS OF YOGA

Blog banner

BharatPe

Blog banner

"Games and the future"

Blog banner

Article on Team Work

Blog banner

Technical Challenges and Directions for Digital Forensics

Blog banner

Building a Simple Doctor Appointment System in Common Lisp

Blog banner

Salt, Sand, and Smiles: Does the Maroubra Lifestyle Affect Your Enamel?

Blog banner

Spyware

Blog banner

Child labour

Blog banner

Simple STEM Activities for Toddlers That Spark Curiosity

Blog banner

10 Problems you face if you are an Otaku

Blog banner

What is thread and alse multithreading

Blog banner

Fun Christmas Activities For Toddlers & Kids

Blog banner

Eating Well With Meal Maharaj on Busy Workdays Without Cooking

Blog banner

THE INPACT OF SOCIAL MEDIA!

Blog banner

computer security

Blog banner