wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

LISP - Library Management System

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

Article on different management system

Blog banner

Why Oak Tree Hotel Is Arcadia’s Hidden Gem?

Blog banner

Memory Management

Blog banner

Microsoft Word

Blog banner

Human factor, a critical weak point in the information security of an organization’s IOT

Blog banner

What your Favorite colour says about You?

Blog banner

Multicore CPUs

Blog banner

How to setup a professional looking business account on Instagram?

Blog banner

The application udemy

Blog banner

Modern operating system

Blog banner

Social Engineering

Blog banner

Veg/Non-veg/Egg Tiffin Meals That Are Nutritious and Filling

Blog banner

IT RISK

Blog banner

Starvation

Blog banner

ZOHO

Blog banner

This Windows 11 encryption bug may cause data damage

Blog banner

Impacts of Data Breach On Companies Challenges and Prevention

Blog banner

Privacy LAWs in IT

Blog banner

The Role of Data Provenance and Lineage in Modern Data Science

Blog banner

MQTT (MQ Telemetry Transport) in Data Science

Blog banner

Google

Blog banner

What is Virtual Memory

Blog banner

Deadlocks in Operating Systems

Blog banner

Functions Of Operating Systems

Blog banner

Deadlock

Blog banner

Electronic data interchange

Blog banner

Europe Through My Lens

Blog banner

Tomato Butter Sauce with Bucatini

Blog banner

Data Visualization – Importance and tools (Tableau, Power BI)

Blog banner

Virtual memory

Blog banner

“CONSISTENCY” in Social Media Marketing

Blog banner

First-Order Logic (FOL): The Foundation of Modern Logic

Blog banner

Evolution of Operating Systems

Blog banner

virtual machine

Blog banner

COMPUTER FORENSICS AND GRAPHICS

Blog banner

Platonic Solids

Blog banner

Cloud Security: Trends and Innovations

Blog banner

Cache Memory

Blog banner

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

Blog banner

How Music Helps Children Develop Memory, Rhythm, and Language

Blog banner

Critical success factors

Blog banner

Operating Systems

Blog banner