Login
|
Signup
langref.org
-
python
,
cpp
,
clojure
, and
fantom
add..
all
csharp
erlang
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 {})
fantom
map := [:].ro
class SolutionXX
{
Void main()
{
map := [:].ro
}
}
Submit a new solution for
python
,
cpp
,
clojure
, or
fantom
There are 17 other solutions in
additional
languages (
erlang
,
fsharp
,
groovy
,
haskell
...)