let map = new Generic.Dictionary<string, string>()
#light open System open System.Collections
let map = new Generic.Dictionary<string, string>()
fsharp
let map = new Hashtable()
#light open System open System.Collections
let map = new Hashtable()
go
m := make(map[int]string)
package main
func main() { m := make(map[int]string) }
groovy
def map = [:]
def map = [:]
groovy
Map map = new HashMap();
Map map = new HashMap();
haskell
import qualified Data.Map as M
emptyMap = M.empty
import qualified Data.Map as M
emptyMap = M.empty
java
Map map = new HashMap();
public class Solution10 { public static void main(String[] args) { Map map = new HashMap(); } }
ocaml
module StringMap = Map.Make (String) let m = StringMap.empty
module StringMap = Map.Make (String) let m = StringMap.empty
ocaml
let m = Hashtbl.create 42
let m = Hashtbl.create 42
perl
# %map = {} # This was wrong, that would have created a hash with one key # of the stringified hash reference (HASH(0xNUMBERSHERE)) and a # value of 'undef', as well as triggering a # "Reference found where even-sized list expected" with the warnings # pragma enabled
my %map;
# %map = {} # This was wrong, that would have created a hash with one key # of the stringified hash reference (HASH(0xNUMBERSHERE)) and a # value of 'undef', as well as triggering a # "Reference found where even-sized list expected" with the warnings # pragma enabled