Oh, ok. I had misunderstood what you are trying to accomplish.FWIW, besides the fact there is not what you want, maybe i should have written in this way...private func generateLoserLocationFunction(numberOfPlayers: Int) -> (column: Int, row: Int) -> (column: Int, row: Int) { switch numberOfPlayers { case 8,16,32: return { row, column in let newCol = -2 * column switch (column,numberOfPlayers) { case (0,_): return (newCol, row / 2) case (1,8), (2,16), (3,32): return (newCol, row ^ 1) case (1,16): return (newCol, 3 - row) case (1,32): return (newCol, (row + 4) % 8) case (2,32): return (newCol, row) default: return (newCol, 0) } } default:abort() } }But going back to you problem, so, if i understand well, it's a case of premature optimization, like in our example of colors:func generateGetColorFunction(numberOfPlayers: Int) -> () -> UIColor { if numberOfPlayers == 8 { return { return UIColor.redColor() } } else if numberOfPlayers == 16 { return { return UI