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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!