wisemonkeys logo
FeedNotificationProfile
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

To-Do List In LISP

profile
Nareen Ansari
Jul 16, 2025
1 Like
0 Discussions
0 Reads

This program allows a user to manage a simple to-do list. The program does:

  1. Add tasks
  2. View tasks


Program:


(defvar *todo-list* '())


(defun add-task ()

(format t "Enter new task: ")

(let ((task (read-line)))

(push task *todo-list*)

(format t "Task added successfully.~%")))


(defun view-tasks ()

(if (null *todo-list*)

(format t "No tasks in the list.~%")

(progn

(format t "~%--- To-Do List ---~%")

(let ((i 1))

(dolist (task (reverse *todo-list*))

(format t "~A. ~A~%" i task)

(incf i))))))


(defun todo-menu ()

(loop

(format t "~%--- To-Do Menu ---~%")

(format t "1. Add Task~%")

(format t "2. View Tasks~%")

(format t "3. Exit~%")

(format t "Choose an option: ")

(let ((choice (read)))

(case choice

(1 (add-task))

(2 (view-tasks))

(3 (progn (format t "Exiting...~%") (return)))

(t (format t "Invalid option.~%"))))))


;; Start the to-do list manager

(todo-menu)



Output:


Comments ()


Sign in

Read Next

ART AND CULTURE OF VRINDAVAN

Blog banner

Guidelines for a Low sodium Diet.

Blog banner

What is Anxiety? How to manage Anxiety?

Blog banner

Fitness

Blog banner

The Right way of cooking

Blog banner

Tomato Butter Sauce with Bucatini

Blog banner

Super Garlicky Tomato Soup with Smashed White Beans

Blog banner

Fudgy Tahini Date Chocolate Bars

Blog banner