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

CYBER SECURITY CHALLENGES

Blog banner

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

Blog banner

Virtual machine.

Blog banner

PHONE TECHNOLOGY

Blog banner

Street foods

Blog banner

Is Pursuing a Dance Career in India Worth it?

Blog banner

Layers Of Blockchain

Blog banner

Bulk E-mail software

Blog banner

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

Blog banner

Memory Management in Operating System

Blog banner

Importance of Website

Blog banner

Why Should You Schedule Tweets on Twitter?

Blog banner

The Importance of Financial Literacy for College Students

Blog banner

Traditional UNIX Scheduling

Blog banner

GIS REMOTE SENSING

Blog banner

TOP 5 GAMING GADGETS (2024)

Blog banner

38_Exploring The Honeynet Project

Blog banner

Ethical Hacking

Blog banner

Service Operation

Blog banner

Video games

Blog banner

What is Segmentation?

Blog banner

How Unstructured Play Helps Children Become Creative Thinkers

Blog banner

Multicore and multithreading 171

Blog banner

DMZ: Your Secret Weapon for Data Security

Blog banner

Virtual Memory

Blog banner

Privacy-Enhancing Computation Techniques

Blog banner

Fashion design

Blog banner

PROCESS STATES OF OPERATING SYSTEM

Blog banner

Virtual Machine

Blog banner

Photography

Blog banner

Internet of Things and cyber security

Blog banner

To travel is to live

Blog banner

RAID

Blog banner

Microsoft Windows Overview

Blog banner

Ubiquitous Computing

Blog banner

TRAIN TRAVELING

Blog banner

Concurrency and Deadlocks

Blog banner

SQL Injection practice on DVWA

Blog banner

Data is an asset and it is your responsibility!

Blog banner

Therapy Myths That Need to End in 2025

Blog banner

Cache memory

Blog banner

A Short History of GIS

Blog banner