Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 28 lines (21 sloc) 0.996 kb
5a0b47c @VincentToups monad tutorial, fixed curry word.
authored
1 (require 'monads)
2 (require 'functional)
3 (require 'utils)
4
5
6 (defvar *people* '(:ted :lea :leo :james :harvey :sally :jane :andrew :catherine) "A list of all the people that matter.")
7 (defvar *friends-db*
8 '((:ted (:lea :leo :sally :andrew :catherine :leo :jane))
9 (:lea (:ted :leo :jane :andrew :harvey :sally :catherine))
10 (:leo (:ted :lea :ted :harvey :sally :jane :andrew :catherine
11 :harvey :andrew :catherine))
12 (:james (:jane :harvey :jane))
13 (:harvey (:leo :lea :leo :james :harvey :harvey :sally))
14 (:sally (:ted :leo :lea :harvey :jane :andrew))
15 (:jane (:lea :leo :james :sally :ted :james :andrew :catherine))
16 (:andrew (:ted :lea :leo :sally :jane :leo))
17 (:catherine (:ted :leo :lea :leo :jane :catherine :catherin))) "Our database of friend connections.")
18
19 (defun friends-of (person)
20 "Return a list of all the people in friends-db."
21 (alist *friends-db* person)
22 ;alist is a function which retrieves
23 ;a key's data from an association list.
24 )
25
26
27
Something went wrong with that request. Please try again.