wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

LISP - Library Management System

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

Information Technology In E- Commerce

Blog banner

Security requirements for Safe E-Payments

Blog banner

Office Lunch Problems in Mumbai and How Tiffin Services Solve Them

Blog banner

File Management In OS

Blog banner

Bulk E-mail software

Blog banner

Payment Card Industry - Data Security Standard PCI-DSS compliance for online banking applications

Blog banner

Sessions In OS.

Blog banner

Why is ITSM important in IT organization?

Blog banner

RAID

Blog banner

KPMG (Klynveld Peat Marwick Goerdeler)

Blog banner

Jio .....A Revolution ?? ??

Blog banner

Kernel Memory Allocation In Linux.

Blog banner

Big Data

Blog banner

Operating System Objectives and Functions

Blog banner

Data Lakes: A Key to Modern Data Management

Blog banner

E-commerce

Blog banner

A MODERN OPERATING SYSTEM

Blog banner

Population

Blog banner

Deadlocks

Blog banner

How To Invest In Indian Stock Market @ BSE & NSE ~ Tutorial 3

Blog banner

SEIZING DIGITL EVIDENCE AT THE SCENE

Blog banner

Types of Big Data

Blog banner

Multiprocessor

Blog banner

gis substation

Blog banner

History of Money

Blog banner

Install Ubuntu in Vmware

Blog banner

Process states

Blog banner

Predicting Student Performance with Data Science

Blog banner

Yahoo! mail

Blog banner

Policies for Service Transition

Blog banner

The Everyday Parenting Dilemma: Safety Vs Independence

Blog banner

Consumer to consumer Business model

Blog banner

Business-to-Business

Blog banner

MoSCoW METHOD IN DATA SCIENCE

Blog banner

internet email and it's applications

Blog banner

File Allocation Methods

Blog banner

Understanding Univariate, Bivariate, and Multivariate Analysis in Data Science

Blog banner

THE INPACT OF SOCIAL MEDIA!

Blog banner

Online Education

Blog banner

Dal Bafla Recipe

Blog banner

10 Interesting facts you should know!!!

Blog banner

Digital marketing spotlight “Dove’s Real Beauty Campaign”

Blog banner