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

Mumbai

Blog banner

Digital black market or dark net poses a national security threat?

Blog banner

Know your Processors!

Blog banner

Virtual memory in os

Blog banner

Access management

Blog banner

John Titor: The Time Traveler

Blog banner

Top 10 Logos and their meanings

Blog banner

Are Social Media Paid Campaigns Worth It?

Blog banner

Virtual memory

Blog banner

Beauty of indian railway

Blog banner

Concurrency management in operating systems

Blog banner

Famous Indian dishes that where misunderstood to be Indian

Blog banner

Memory Management

Blog banner

Data carving - using hex editor

Blog banner

Cache Memory in Operating Systems

Blog banner

Paralysis/Paralysis Stroke

Blog banner

security controls

Blog banner

ZOHO

Blog banner

The Future of Patola Weaving in a Sustainable Fashion World

Blog banner

Article on Fresh Book

Blog banner

38_Exploring The Honeynet Project

Blog banner

LINUX VSERVER VIRTUAL MACHINE ARCHITECTURE

Blog banner

Odoo

Blog banner

How to write a cover letter

Blog banner

Disk Management

Blog banner

Simple Ways of Avoiding Basic Mistakes in Smart Phone Security

Blog banner

IO Buffers

Blog banner

HTML vs HTML5

Blog banner

10 Interesting Facts about Attack on Titan

Blog banner

memory cache

Blog banner

Race Conditions

Blog banner

Security Breaches in Stock market trading

Blog banner

PROCESS CONTROL BLOCK IN OS

Blog banner

Types Of Interrupt

Blog banner

Atlantis - The Lost Island.........

Blog banner

Blog on Smartsheet.

Blog banner

Solving Problems with AI: The Power of Search Algorithms

Blog banner

Data Mining

Blog banner

The House ??of Patola Designs: Traditional Weaves with a Modern Twist

Blog banner

Deadlock

Blog banner

Everything You Need for a Perfect Stay in Arcadia, Florida, USA.

Blog banner

Music is life

Blog banner