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

FREE VERSION OF G-MAIL

Blog banner

OPERATING SYSTEM

Blog banner

Operating system

Blog banner

LEMON PICKLE SWEET AND MILD HOT

Blog banner

Electronic Funds Transfer

Blog banner

Buffers in Operating Systems

Blog banner

Life of a 2020-2021 student

Blog banner

Phishing

Blog banner

Deadlock and Starvation

Blog banner

To-Do List In LISP

Blog banner

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

Blog banner

Kernel in Operating System

Blog banner

Place to visit in pune

Blog banner

Water Resources are about to exhaust...

Blog banner

New Ransomware Encrypts Your Android And Then Changes PIN Lock

Blog banner

LIMITED EDITION

Blog banner

No Compromise on Health: How Meal Maharaj Brings “Freshly cooked meals” to Your Office Desk

Blog banner

GIS Bharat Maps

Blog banner

BharatPe

Blog banner

Security and E-mail

Blog banner

Women empowerment

Blog banner

1.1 basic elements

Blog banner

From Loom to Luxury: How Patola Elevates Modern Wardrobes

Blog banner

Security Issues and Countermeasures

Blog banner

Women’s Mental Health (After Marriage)

Blog banner

Social Engineering Attacks

Blog banner

6 Digital Marketing Trends You Must Watch Out For In 2022

Blog banner

Concept and definition of m-commerce

Blog banner

Understanding Gen Z: A Generation Facing Crisis and Potential

Blog banner

Real-time Scheduling - 53003230061

Blog banner

Google classroom

Blog banner

Getting into Anime

Blog banner

The application udemy

Blog banner

Security in Operating Systems

Blog banner

Fossil Hunting 101 at the Peace River, Arcadia, Florida, USA

Blog banner

A BLOG ON MYSQL

Blog banner

Assignment 2

Blog banner

TRELLO

Blog banner

TRAIN TRAVELING

Blog banner

Mutual exclusion

Blog banner

Data Science in Healthcare: Predicting Diseases

Blog banner

COMPUTER FORENSICS AND GRAPHICS

Blog banner