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

Thumb Sucking: When It’s Normal and When It Becomes a Dental Problem

Blog banner

Introduction to GIS

Blog banner

What is Data, Information and Knowledge?

Blog banner

NodeJs

Blog banner

Memory Management

Blog banner

Why Peace River Is Florida’s Most Underrated Outdoor Adventure Destination?

Blog banner

The Khan mehtab transforming the modular switches

Blog banner

Excel records

Blog banner

RAID - LEVELS OF RAID

Blog banner

GEOLOGY AND GEO-TECTONIC FRAME WORK OF WESTERN BASTAR CRATON

Blog banner

Cyber Security Standards

Blog banner

Ethical Hacking

Blog banner

Buffering

Blog banner

A Brief Review on Cyber Forensics and its Analysis Tool

Blog banner

Os Virtual Memory

Blog banner

LIFEHACKER

Blog banner

Virtual memory

Blog banner

How User Data Shapes Personalised Campaigns

Blog banner

Google App Engine

Blog banner

THE LEGAL ISSUES OF COMPUTER FORENSICS IN INDIA

Blog banner

Remote Work in 2026

Blog banner

Data Exfiltration

Blog banner

IT RISK

Blog banner

Zero-Click Searches: How To Stay Visible In Google’s New Era

Blog banner

Evolution of Operating system.

Blog banner

SmartData Collective: Data Science aur Analytics ki Duniya

Blog banner

Scala - a programming tool

Blog banner

File management In Operating System

Blog banner

Memory Management

Blog banner

Coping with Diagnosis Shock

Blog banner

SMARTSHEET MANAGEMENT SYSTEM

Blog banner

MORDERN UNIX SYSTEM

Blog banner

Honeypot in cyber security

Blog banner

What is Amazon?

Blog banner

The functions of operating system

Blog banner

Perfect Moments to Wear a Rich Patola Design Outfit

Blog banner

undefined

Blog banner

38_Exploring The Honeynet Project

Blog banner

Whatsapp Messenger

Blog banner

Personalized Movie Recommendations with Data Science

Blog banner

Password Generator - Lisp

Blog banner

Mental Health

Blog banner