Skip to content

Instantly share code, notes, and snippets.

@davidkellis
Created June 15, 2014 03:29
Show Gist options
  • Save davidkellis/af1b4301aaf54fa43982 to your computer and use it in GitHub Desktop.
Save davidkellis/af1b4301aaf54fa43982 to your computer and use it in GitHub Desktop.
> open Archer.Collections;;
> let c = new LruCache<int,string>(3);;
val c : LruCache<int,string>
> c.Add(5, "a");;
val it : unit = ()
> c.Add(6, "b");;
val it : unit = ()
> c.Add(7, "c");;
val it : unit = ()
> c.ContainsKey(1);;
val it : bool = false
> c.ContainsKey(5);;
val it : bool = true
> c.ContainsKey(6);;
val it : bool = true
> c.ContainsKey(7);;
val it : bool = true
> c.ContainsKey(8);;
val it : bool = false
> c.Add(8, "d");;
val it : unit = ()
> c.ContainsKey(5);;
val it : bool = false
> c.ContainsKey(6);;
val it : bool = true
> c.ContainsKey(7);;
val it : bool = true
> c.ContainsKey(8);;
val it : bool = true
> c.ContainsKey(7);;
val it : bool = true
> c.Add(9, "e");;
val it : unit = ()
> c.ContainsKey(6);;
val it : bool = false
> c.ContainsKey(7);;
val it : bool = true
> c.ContainsKey(8);;
val it : bool = true
> c.ContainsKey(9);;
val it : bool = true
> c.ContainsKey(7);;
val it : bool = true
> c.Add(10, "f");;
val it : unit = ()
> c.ContainsKey(7);;
val it : bool = true
> c.ContainsKey(8);;
val it : bool = false
> c.ContainsKey(9);;
val it : bool = true
> c.ContainsKey(10);;
val it : bool = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment