Last active
May 26, 2017 15:09
-
-
Save deque-blog/3089ca9283df85c90ab55391a182847c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn head-and-tail | |
[[x & xs]] ; Destructuring of the input container | |
{:head x ; `x` contains the first element | |
:tail xs}) ; `xs` contains the remaining elements | |
; Example call | |
(head-and-tail [1 2 3]) | |
=> {:head 1, :tail (2 3)} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment