CS 5010: Guided Practice 4.1

Consider the following data definition:

    ;; A ListOfStrings (LOS) is one of
    ;; -- empty
    ;; -- (cons String LOS)
  

Which of the following expressions has a value that is a LOS ?

  1. (cons "abc" empty)
  2. (cons "bcd")
  3. (cons "cde" (cons "ef" empty))
  4. (cons "3" (cons "4" empty))
  5. (cons 3 (cons 4 empty))

[ANSWER]

For debugging: Click here to validate.