Login
|
Signup
langref.org
-
ruby
,
csharp
,
erlang
, and
clojure
add..
all
cpp
fantom
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
Lists
Declaration
Define a static list
Define the list
[One, Two, Three, Four, Five]
ruby
list = ['One', 'Two', 'Three', 'Four', 'Five']
list = ['One', 'Two', 'Three', 'Four', 'Five']
p list
ruby
list = %w(One Two Three Four Five)
list = %w(One Two Three Four Five)
p list
csharp
IList<string> list = new string[]{"One","Two","Three","Four","Five"};
IList<string> list = new string[]{"One","Two","Three","Four","Five"};
erlang
List = [one, two, three, four, five],
-module(statlist).
-export([start/0]).
start() ->
List = [one, two, three, four, five],
io:format("~B~n", [length(List)]).
erlang
List = ['One', 'Two', 'Three', 'Four', 'Five'],
-module(statlist).
-export([start/0]).
start() ->
List = ['One', 'Two', 'Three', 'Four', 'Five'],
io:format("~B~n", [length(List)]).
clojure
(def a '[One Two Three Four Five])
(def a '[One Two Three Four Five])
Submit a new solution for
ruby
,
csharp
,
erlang
, or
clojure
There are 30 other solutions in
additional
languages (
cpp
,
fantom
,
fsharp
,
go
...)