Screen-Cast: Using Tuples to Carry Information Forward in a Transform
Return to the RPFT Screen-Cast SeriesIn a transform, you sometimes can’t directly transform from the source data to the final results. Often, it makes more sense to do one or more intermediate transforms before transforming to the final form. In this intermediate transform you need to calculate or otherwise determine certain values that are useful in further transforms. This also often has a direct correlation to how you think about the transform – before starting coding of a transform, I first have a mental model of what the transform taken as a whole will do, and a mental model of each of the intermediate steps. When you calculate values in intermediate steps, the most common approach to ‘recording’ this information and ‘carrying it through’ to other parts of the transform is to use tuples. This screen-cast explains what tuples are, and gives a couple of concrete examples of their use.