DEV Community

Vee Satayamas
Vee Satayamas

Posted on

cons car cdr

(cons "dog" "cat")

+------------------+-----------------+
|                  |                 |
|                  |                 |
|                  |                 |
|        X         |        X        |
|        |         |        |        |
|        |         |        |        |
|        |         |        |        |
+--------|---------+--------|--------+
         |                  |
         |                  |
         V                  V
       "dog"              "cat"
Enter fullscreen mode Exit fullscreen mode

(car (cons "dog" "cat"))

"dog"
Enter fullscreen mode Exit fullscreen mode

(cdr (cons "dog" "cat"))

"cat"
Enter fullscreen mode Exit fullscreen mode

Top comments (0)