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