What is (append '(a b) '(c d)) ?

  • A: ((a b) (c d))
  • B: (a b c d)
  • C: (a b (c d))
  • D: ((a b c d))
  • E: ((a b) c d)

    Answer: B

    append concatenates two lists at top level, making a single list that contains the elements of the two input lists.

    append makes a copy of the first input list, and reuses the second input list.

    Contents    Page-10    Prev    Next    Page+10    Index