Coem

sleep.coem

The code is annotated: hover to learn more!

to sl?eepwhen:
    dreams. † dreams dreams dreams

sleepnow
sleepnever
seepcontinually

Walkthrough

The first block defines a function. The question mark in the name of the function means either 0 or 1 of the token before, which means that it can be either sleep or seep. The two em dashes are analogous to opening and closing parentheses in other programming languages, and, similarly, parameters go in between the two symbols. This means that when the function is called, it expects something to be passed in, and it gives that thing the name when.

to sl?eepwhen:

Within the function, all we do is print the string “dreams”. The full stop or period indicates the end of the function. The function is called three times, so the resulting output comment has three instances of “dreams”.

    dreams. † dreams dreams dreams

Elsewhere, we call the function three times, passing in different arguments each time. We can call the function using the identifier sleep or seep—both refer to the same function.

sleepnow
sleepnever
seepcontinually