Question
Write an emacs/lisp program (Provide proof it works) A function called const that takes one parameter that we can assume to be a list, and
Write an emacs/lisp program (Provide proof it works)
A function called const that takes one parameter that we can assume to be a list, and returns t if all the elements of the list are identical to each other (or what we could call, a constant list) and nil otherwise. Note that both an empty list and one that has only one element can be considered constant. Use the function equal to test for equality. Implementation suggestion: with the dolist loop.
What the results should look like: (const '()) ; t (const '(a)) ; t (const '(1 2 3)) ; nil (const '(2 2 2 2)) ; t
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started