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

Impact of social media on the human life

Blog banner

How social media affect

Blog banner

Domain Name System

Blog banner

The Peephole

Blog banner

Virtual Memory

Blog banner

Concept and definition of m-commerce

Blog banner

Self Confidence

Blog banner

Message Passing in OS

Blog banner

Deadlock

Blog banner

I/O Management and Disk Scheduling

Blog banner

Traveling

Blog banner

Operating system and overviews

Blog banner

ARTICLE ON WRIKE CORPORATION

Blog banner

Making Money through Instagram

Blog banner

Explain website hacking issues

Blog banner

A Review on Data Acquisition in Cyber Forensics

Blog banner

Classification Algorithms (Decision trees, SVM, Logistic regreession)

Blog banner

ACHIEVEMENTS IN OPERATING SYSTEMS

Blog banner

A Journey By Train

Blog banner

CSI and Organizational Change

Blog banner

Trends that began during the pandemic

Blog banner

Exploring Virtual Machines and Computer Forensic Validation Tools

Blog banner

The application udemy

Blog banner

M commerce

Blog banner

WHAT IS SNAPCHAT AND HOW DOES IT WORK?

Blog banner

IOT- Internet Of Things

Blog banner

The Rich Heritage Of Patola Sarees: Gujarat’s Timeless Weaving Art

Blog banner

Sage

Blog banner

Drawing tips for a beginner

Blog banner

Multicore CPUs

Blog banner

VIRTUAL MACHINE

Blog banner

Microsoft Word

Blog banner

Ola

Blog banner

Theads

Blog banner

'C', 'C++' and 'Java': Head-to-Head

Blog banner

Challenges and risks in service operations

Blog banner

THE ROLE OF CYBER FORENSICS IN CRIMINOLOGY

Blog banner

Data is an asset and it is your responsibility!

Blog banner

Threads

Blog banner

Uber

Blog banner

Mumbai

Blog banner

LINUX VSERVER VIRTUAL MACHINE ARCHITECTURE

Blog banner