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

Real Time Scheduling

Blog banner

Gis in agriculture and farming

Blog banner

Steps to create an Ubuntu EC2 Instance with GUI in AWS

Blog banner

Health is Wealth

Blog banner

Memory Management

Blog banner

Blog name

Blog banner

Dental Problems That Start Small But Should Never Be Ignored

Blog banner

ROLE OF THE COMPUTER FORENSICS TOOLS AND TECHNIQUES

Blog banner

Memory management

Blog banner

MENDELEY

Blog banner

The Role of Data Provenance and Lineage in Modern Data Science

Blog banner

Virtual memory in os

Blog banner

Multiprocessor and Multicore Organization

Blog banner

A-B-C of Networking: Part-2 (Components)

Blog banner

Cloud Security: Trends and Innovations

Blog banner

TECHNOLOGY : BOON OR CURSE ?

Blog banner

Session Hijacking Techniques

Blog banner

Types Of scheduling

Blog banner

Travel: Everything Everywhere!

Blog banner

Linker

Blog banner

Cache Memory(142)

Blog banner

Interesting fact about kangaroo.

Blog banner

Big Data

Blog banner

Understanding Mobile Device Forensics

Blog banner

The Khan mehtab transforming the modular switches

Blog banner

OS Evolution Achievements

Blog banner

(Input/Output) in os

Blog banner

You'll get to know about Pankaj Negi

Blog banner

MOBILE DEVICE FORENSIC

Blog banner

Linux 94

Blog banner

Deadlock

Blog banner

MACHINE LEARNING

Blog banner

10 Unknown facts about India's Independence

Blog banner

My First Trek - Sondai, Karjat - Shoaib Malik

Blog banner

Which Smartphone Company Has the Largest Market Share in India?

Blog banner

Artical on FreshBooks

Blog banner

Device driver

Blog banner

Deadlock and Starvation

Blog banner

Raising Emotionally Intelligent Students: The Classroom Beyond Academics

Blog banner

Routers

Blog banner

Embaded operating system

Blog banner

Understanding Gen Z: A Generation Facing Crisis and Potential

Blog banner