Is there a shorter way of creating an IDictionary<_,obj>, possibly without boxing every value? This is what I have.
let values =
[ \"a\"
A variation of Stephen's idea:
open System
open System.Collections.Generic
type Dictionary<'a,'b> with
member this.Add([] args:obj[]) =
match args.Length with
| n when n % 2 = 0 ->
for i in 1..2..(n-1) do
this.Add(unbox args.[i-1], unbox args.[i])
| _ -> invalidArg "args" "even number of elements required"
let d = Dictionary()
d.Add(
"a", 1,
"b", "foo",
"c", true
)