quote:Original post by Alpha_ProgDesstring fruits[] = {"apples", "oranges", "pears", "bananas"};
What did we miss here in our Lisp lessons? Unfortunately, that''s not even close. You just created an array of strings (which you can do in Lisp as well), but that''s not what the Lisp example does.
Here are the deficiencies in your C++ code:
- It is an array, not a list composed of cons cells.
- fruits is a different type from "apples".
- In fact, "apples" is only a value, and not a reference in your code.
- fuits cannot be reset to something else easily.
- We cannot extract the spelling of the term fruits.
- We can''t ask our program at runtime what type fruits is.
- We haven''t coded any way of determining the number of values in the array called fruits.
- I could go on...