wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

LISP - Library Management System

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

Is it important to follow all the trends that come up on social media?

Blog banner

Memory Management

Blog banner

This too shall pass

Blog banner

IT Service as as Value Creation

Blog banner

Hey Aryan here

Blog banner

HACKING MOBILE PLATFORM

Blog banner

Question

Blog banner

The Role of Cyber Forensics in Addressing Cyber security Challenges in Smart Cities

Blog banner

Mariana Trench: The deepest depths

Blog banner

Cache Memory

Blog banner

Microsoft Windows Overview

Blog banner

Security issues

Blog banner

What is Email? Uses of Emails

Blog banner

'Positivity in life'

Blog banner

EID UL FITR

Blog banner

Uniprocessor scheduling

Blog banner

Fudgy Tahini Date Chocolate Bars

Blog banner

38_Network Sniffing Techniques_SBC

Blog banner

Telegram and it's features

Blog banner

THE ACTORS LIFE

Blog banner

Linux 94

Blog banner

10 Interesting Facts about Death Note

Blog banner

Types of email

Blog banner

Regression Analysis

Blog banner

Music helps reduce stress

Blog banner

Technological Advancement

Blog banner

Modern Operating System - Khush Bagaria

Blog banner

The Art Of Getting What You Want In Life....

Blog banner

?Why Social and Emotional Skills Matter More Than ABCs in Early Years?

Blog banner

Emerging threats in cyber Forensics

Blog banner

Big O Notation

Blog banner

Service Design Principles

Blog banner

GOOGLE

Blog banner

Virtual machine.

Blog banner

Article on Team Work

Blog banner

To travel is to live

Blog banner

Linux -V Server Virtual Machine

Blog banner

World’s rarest passport owned by 500 people.

Blog banner

Modern OS

Blog banner

The Rise of Evil Twin Attacks: A New Kind Of Spoofing Cyberattack

Blog banner

Data Lakes: A Key to Modern Data Management

Blog banner

Clarizen

Blog banner