Login
|
Signup
langref.org
-
python
,
cpp
, and
clojure
add..
all
csharp
erlang
fantom
fsharp
go
groovy
haskell
java
ocaml
perl
php
ruby
scala
Home
All
Solved
Unsolved
Strings
Numbers
Regex
Lists
Maps
Structure
Files
Dates
OOP
Networking
XML
Algorithms
Misc
Parallel
View Problem
Maps
Declaration
Define an unmodifiable empty map
python
2.6
import collections
EmptyDict = collections.namedtuple("EmptyDict", "")
e = EmptyDict()
import collections
EmptyDict = collections.namedtuple("EmptyDict", "")
e = EmptyDict()
cpp
const std::map<T1,T2> immutable_map_instance_of_type_t1_to_t2;
const std::map<T1,T2> immutable_map_instance_of_type_t1_to_t2;
clojure
; Clojure maps are immutable
(def m {})
; Clojure maps are immutable
(def m {})
Submit a new solution for
python
,
cpp
, or
clojure
There are 18 other solutions in
additional
languages (
erlang
,
fantom
,
fsharp
,
groovy
...)