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

A book review

Blog banner

Memory Management

Blog banner

Operating system and overviews

Blog banner

Memory management

Blog banner

An Approach To Spyware Detection And Removal

Blog banner

I/O Management and Disk Scheduling

Blog banner

The Truth Behind Viral DIY Dental Hacks

Blog banner

INDIAN CHEAPEST COSMETICS BRAND

Blog banner

Secure Hypertext transfer protocol

Blog banner

Data Science & AI

Blog banner

Modern operating system

Blog banner

Cache memory

Blog banner

Deadlock

Blog banner

Making Money through Instagram

Blog banner

Retiring ISS

Blog banner

Memory Management

Blog banner

Health and fitness

Blog banner

Uniprocessor scheduling

Blog banner

Man In The Middle Attack

Blog banner

Operating Systems Overview

Blog banner

Mumbai Metro 3

Blog banner

Deadlock and Starvation

Blog banner

What is Spyware? and examples of them.

Blog banner

Self defence

Blog banner

15 Interesting Facts about India

Blog banner

The khan mehtab transforming the modular switches company

Blog banner

Google

Blog banner

TOGETHER WE CAN CONQUER #team

Blog banner

Career v/s Job : Choose your passion

Blog banner

CYBERPEACEKEEPING: NEW WAYS TO PREVENT AND MANAGE CYBERATTACKS

Blog banner

Memory input output management

Blog banner

What is Network Security?

Blog banner

Virtual machine.

Blog banner

THE INPACT OF SOCIAL MEDIA!

Blog banner

The Laws of Karma

Blog banner

Malicious softwares

Blog banner

Music

Blog banner

QUANTUM COMPUTING IN SECURITY:A GAME CHANGER IN DIGITAL WORLD

Blog banner

Multiprocessor and scheduling

Blog banner

Image Steganalysis in Digital Forensics

Blog banner

Understanding Input Based Keylogger Activation Systems: Risks and Mitigation

Blog banner

IP ADDRESS

Blog banner