CSC448: Parsing: Coding Conventions [29/133] |
Immutable data structures simplify transformations.
Linked lists and maps.
CAUTION: list.cons (x)
does not mutate list
!
list.cons (x); // INCORRECT: DISCARDS RESULT list2 = list.cons (x); // CORRECT: MAKES USE OF RESULT list = list.cons (x); // CORRECT: MAKES USE OF RESULT