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

Business Intelligence v/s Big Data

Blog banner

BUSINESS MODELS OF E COMMERCE

Blog banner

Game Theory in Blockchain

Blog banner

Cyber Crime Investigation In The Era Of Big Data

Blog banner

Product Discount Calculator

Blog banner

My First Trek - Sondai, Karjat - Shoaib Malik

Blog banner

Mental Health

Blog banner

Biometric Authentication Vulnerabilities

Blog banner

THREADS (assignment 1)

Blog banner

Google

Blog banner

HR Automation : Need of the hour

Blog banner

Deadlock in Operating systems

Blog banner

What is a Dumpster Diving Attack?

Blog banner

Uniprocessor Scheduling

Blog banner

WomenEmpowerment

Blog banner

Go Daddy

Blog banner

File management -disha parekh

Blog banner

WINDOWS I/ O

Blog banner

Real Time Scheduling

Blog banner

Internet: The Vast Ocean Of Knowledge.

Blog banner

1.1 basic elements

Blog banner

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

Blog banner

ADD A SPICE TO YOUR LIFE.

Blog banner

Kernel Memory Allocation In Linux.

Blog banner

Virtual Machine

Blog banner

Evolution of Operating Systems

Blog banner

OS Assignment 3 Deadlock

Blog banner

COMPUTER FORENSICS AND GRAPHICS

Blog banner

Classification Vs Clustring? What's the diffrence?

Blog banner

MEMORY FORENSIC ACQUISITION AND ANALYSISOF MEMORY AND ITS TOOLS COMPARISON

Blog banner

Volatile Memory & Non-Volatile Memory Explained

Blog banner

Junk food vs healthy food

Blog banner

Understanding Mobile Device Forensics

Blog banner

Segmentation and paging concept

Blog banner

Blockchain Transactions

Blog banner

Deadlock in operating system

Blog banner

Service Operations Principles

Blog banner

Microsoft Windows Overview

Blog banner

History of Money

Blog banner

differentiate thinking humanly and rationally

Blog banner

I/O Buffering

Blog banner

MEMORY HIERARCHY

Blog banner