[ prog / sol / mona ]

prog


What are you working on?

31 2019-01-05 11:49

http://ix.io/1xv1

While I won't be touching the political stuff on a programming board, here are some programming observations:
- Both the 'down' and 'incomp' functions contain lambdas that repeat the same (vector-ref ballot party) lookup on each round. For the purposes of the lambdas this is a constant computation and should be done once, before the ballot-filter-sum invocations.
- Your *-sum function increments a 0-based accumulator by either 0 or 1 based on the suitability of each item. This is called a *-count.
- Both 'ballot-max' and 'ballot-filter-sum' are vector folds. Writing them in terms of a vector-fold would be cleaner.
- The 'tally' function contains an inlined vector-inc!, which could be made explicit.

199


VIP:

do not edit these