MAKE-PLAYERS: the element-type argument is typically not useful. This argument in Common Lisp is only used in Common Lisp to allocate specialized arrays, but for player there will be no specialized array. All you will get is the usual array, which has an element type of
T
.MAKE-PLAYER: you can also make a list of players and coerce the list into a VECTOR
GET-HIGH-SCORER: you can for example sort a copy of the list and get highest scorer(s)
DISPLAY-SCORE: you could use `(LOOP FOR player ACROSS (players game) do ...)
(LOOP FOR player ACROSS (players game) do ...)
setup: package, helper stuff
managing domain class 1: game
managing domain class 2: player
domain functionality 1: setup of the game
domain functionality 2: start of a game
domain functionality 3: playing a turn
domain functionality 4: scoring
domain functionality 5: end of a game
Such a 'domain functionality' could be implemented as CLOS generic functions with its methods and its helper functions.
In most OOP languages such a program is structured around the class tree. In Java even a single inheritance class tree.
CLOS allows you to break it up:
- the class tree can be flattened with modular mixins
- the classes provide the nouns: game, player, ...
- generic functions provide the verbs : play, start, play-turn, ...
- generic functions don't belong to a class, not even textually
- generic functions can dispatch on multiple arguments