I don't know Ruby at all, but my guess is that the statement is splitting the list a
into a head (first element) and the rest (another list), assigning the new values to the variables head
and tail
.
This mechanism is usually referred (at least in Erlang) as pattern matching.