Writing with Ink – Lists with an Oxford Comma

The guys at Inkle Studios have shared their method for printing a list using a recursion function on their Patreon page, but I found an easier method to insert an Oxford Comma when printing a list.

{LIST_COUNT(IsPresent):
- 0: No one is here.
- 1: Only {IsPresent} is here.
- 2: {LIST_MIN(IsPresent)} and {LIST_MAX(IsPresent)} are here.
- else: {IsPresent-LIST_MAX(IsPresent)}, and {LIST_MAX(IsPresent)} are here.
}

In this example I’m grabbing the LIST_COUNT of IsPresent, and printing the contents according to how many items there are.

With 3 or more in the list I subtract the LIST_MAX (the last item in the list) from the full list before printing, then insert a comma before printing the LIST_MAX.