wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Building a Simple Doctor Appointment System in Common Lisp

profile
Shubham Giri
Jul 16, 2025
0 Likes
0 Discussions
1 Reads

🧠 Introduction

When learning a new language, building real-world applications—no matter how simple—is a powerful way to understand its core features. In this post, we will implement a console-based doctor appointment scheduling system in Common Lisp. It will allow users to book, cancel, and view appointments using a clean menu-driven interface.


🛠️ Features Overview

View Available Time Slots


Book an Appointment


Cancel an Appointment


View All Booked Appointments


Exit the System


📦 The Core Components

Let’s walk through how each part of the code contributes to the functionality:


1. 📅 Defining Time Slots


(defparameter *time-slots*

'("9:00 AM" "10:00 AM" "11:00 AM" "12:00 PM"

"2:00 PM" "3:00 PM" "4:00 PM" "5:00 PM"))

These are our fixed time slots. The user can choose from these to book an appointment.


2. 📂 Creating the Appointments Table


(defparameter *appointments* (make-hash-table :test 'equal))

A hash table is used to store appointments, mapping each slot to a user's name.


3. 🔍 Viewing Available Slots


(defun view-available-slots ()

(format t "~%Available Slots:~%")

(dolist (slot *time-slots*)

(unless (gethash slot *appointments*)

(format t "~A~%" slot))))

This function filters out already booked slots and shows only the available ones.


4. 📥 Booking an Appointment


(defun book-appointment ()

;; code continues...

)

The user enters their name and picks a slot. The function validates the input and checks availability before booking.


5. ❌ Cancelling an Appointment


(defun cancel-appointment ()

;; code continues...

)

Users can cancel their appointments by providing their name. It searches the hash table and removes matching entries.


6. 📋 Viewing All Appointments


(defun view-appointments ()

;; code continues...

)

Prints a list of all booked slots along with the names of users who booked them.


7. 📱 User Interface - The Main Menu

(defun main-menu ()

;; loop with case options

)

A looping text interface that allows the user to interact with the system repeatedly until they choose to exit.




Comments ()


Sign in

Read Next

Bitcoin sent using radio waves! No internet!

Blog banner

Data Science in Healthcare: Predicting Diseases

Blog banner

Office Lunch Problems in Mumbai and How Tiffin Services Solve Them

Blog banner

Street foods

Blog banner

Improving the Accuracy of GPS and GNSS

Blog banner

Operating system

Blog banner

Rules and Regulations of Networking: "Standards and Protocols" - Part 1

Blog banner

Embaded operating system

Blog banner

Different types of e-commerce platforms or advantages and disadvantages

Blog banner

De-Coding Love

Blog banner

In the world of Technology...

Blog banner

Esri India launches Policy Maps.

Blog banner

APACHE KAFKA

Blog banner

Way to make your meal healthier.

Blog banner

Hot Mango Pickle (Methiyu)

Blog banner

Some web vulnerabilities

Blog banner

Python as a tool for Data science task & project

Blog banner

Modern Operating System

Blog banner

Koinex is shutting down and here is how you can withdraw...

Blog banner

Wiretapping

Blog banner

Business Engineering

Blog banner

File Management

Blog banner

The New Classic: Indo Western Patola Outfits for Today’s Woman

Blog banner

What Makes Patola the Queen of Silk?

Blog banner

Memory Management Techniques

Blog banner

?Why Does My Breath Still Smell After Brushing?

Blog banner

How Preschool Annual Day Shapes Confidence, Emotions, and Growth

Blog banner

USPS mail

Blog banner

Simple Ways of Avoiding Basic Mistakes in Smart Phone Security

Blog banner

Why Should You Schedule Tweets on Twitter?

Blog banner

Importance Of Blockchain

Blog banner

Artical on FreshBooks

Blog banner

Disk scheduling

Blog banner

Risk factors in service transistion

Blog banner

Deadlock

Blog banner

Online Games

Blog banner

Understanding the 'Ambiverts'

Blog banner

To-Do List In LISP

Blog banner

objectives and functions of operating system

Blog banner

21ST CENTURY PATRIARCHY

Blog banner

Security in Operating Systems

Blog banner

Developments in Modern Operating Systems

Blog banner