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
3 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

Royal enfield

Blog banner

Virtual machine.

Blog banner

MODERN OPERATING SYSTEM

Blog banner

Top 5 Places To Stay And Visit In Berlin, Germany

Blog banner

Race condition

Blog banner

Craziness of dream 11 and how it impacts on our life

Blog banner

Mumbaicha Dabbawalla

Blog banner

IoT Architecture Based Security

Blog banner

Things You Should Leave Behind In 2025, Whilst In 2026

Blog banner

The Joy of Giving: How Festivals Teach Children Empathy and Gratitude

Blog banner

RAID and It's Levels

Blog banner

Types of threads

Blog banner

Data Visualization

Blog banner

Memory Management

Blog banner

Data Mapping

Blog banner

Title: Network Sniffing Techniques: Uncovering the Secrets of Data Transfer

Blog banner

NodeJs

Blog banner

AutoML: The Future of Automated Data Science

Blog banner

Efficiency of SQL Injection Method in Preventing E-Mail Hacking

Blog banner

Population

Blog banner

Instagram Features in 2023 That Will Leave You Stunned!

Blog banner

The IT Service Lifecycle

Blog banner

Number Guessing game --lisp

Blog banner

Deadlock

Blog banner

JIRA SOFTWARE

Blog banner

Some facts about Technology

Blog banner

Life

Blog banner

Caching windows

Blog banner

OPERATING SYSTEM OBJECTIVES AND FAULT TOLERENCE.

Blog banner

geographic information system (GIS)

Blog banner

My Favorite Country

Blog banner

Social media

Blog banner

"Geographic Information Systems (GIS) and its Applications in Urban Planning"

Blog banner

Palm Vein Biometric Technology; Contactless vein authentication

Blog banner

The Benefits of Practical Life Activities in Preschool

Blog banner

Why we fail after giving 100% ?

Blog banner

The Impact of Tolerances and Wall Thickness on Pipeline Integrity

Blog banner

A buffer overflow

Blog banner

Cyber Forensics in a Ransomware Attack Recovery

Blog banner

What is a geographic information system (GIS)?

Blog banner

GEOLOGY AND GEO-TECTONIC FRAME WORK OF WESTERN BASTAR CRATON

Blog banner

VPN

Blog banner