30.5k views
1 vote
If cons is applied with two atoms, say 'a and 'b, what is the result? Briefly explain why.

User Trey Keown
by
7.7k points

1 Answer

4 votes

Final answer:

The result of applying 'cons' with two atoms 'a and 'b is a list consisting of 'a as the first element and 'b as the second element.

Step-by-step explanation:

When 'cons' is applied with two atoms, say 'a and 'b, the result is a list consisting of 'a as the first element and 'b as the second element. This is because 'cons' is a function in programming languages that is used to construct a list by adding an element to the beginning of an existing list. In this case, the element 'a is added to the list containing only the element 'b.

User Yogurt The Wise
by
8.2k points