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

Direct Memory Access

Blog banner

My First Trek - Sondai, Karjat - Shoaib Malik

Blog banner

OS Assignment 3

Blog banner

DATA WRANGLING

Blog banner

Street foods

Blog banner

Honeypot in cyber security

Blog banner

Self defence

Blog banner

Smartsheet

Blog banner

"Can Lisp do Machine Learning?"

Blog banner

Cache Memory

Blog banner

Concurrency:Deadlock and Starvation

Blog banner

The Role of Frontline Managers in Driving Workplace Performance and Customer Satisfaction

Blog banner

Simple AI Symptom Diagnosis Using LISP – Rule-Based Expert System

Blog banner

BITCOIN WALLET

Blog banner

Satellite Based Positioning

Blog banner

EdTech (Education Technology)

Blog banner

"The Benefits of Using GIS in Agriculture"

Blog banner

Zoho

Blog banner

note taker app

Blog banner

Cache memory

Blog banner

FIREWALL

Blog banner

Predictive Analytics: How Data Science Predicts Trends(Weather ,Stock Market,Sales Forecasting ).

Blog banner

Indian Culture and Tradition

Blog banner

Study of Backdoor and Trojan tools

Blog banner

PERSONALITY DEVELOPMENT

Blog banner

Security Issues and Countermeasures

Blog banner

TOGETHER WE CAN CONQUER #team

Blog banner

The Evolution of the Microprocessor ~ Aditya Pai

Blog banner

Deadlock in operating system

Blog banner

Deadlock

Blog banner

Should you be using a mouthwash? Know from the experts

Blog banner

Tiranga - Abbas Haveliwala

Blog banner

Apache Spark :- Powerful Data Processing Tool

Blog banner

How to write a cover letter

Blog banner

Analysis of Digital Evidence In Identity Theft Investigations

Blog banner

Session Hijacking

Blog banner

Operating Systems Overview

Blog banner

COMFORT IS ALL ABOUT FASHION

Blog banner

Review on Cyber Forensics and its Analysis Tools

Blog banner

Firewall

Blog banner

“CONSISTENCY” in Social Media Marketing

Blog banner

ARTICLE ON WRIKE CORPORATION

Blog banner