Login
|
Signup
langref.org
-
ruby
,
erlang
,
clojure
,
go
...
add..
all
cpp
csharp
fsharp
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 an empty list
Assign the variable
"list"
to a list with no elements
ruby
list = []
list = []
ruby
list = Array.new
list = Array.new
erlang
List = [],
-module(emptylist).
-export([start/0]).
start() ->
List = [],
io:format("~B~n", [length(List)]).
clojure
(list)
(list)
clojure
'()
'()
go
var l []string;
package main
import "fmt"
func main() {
var l []string;
l = make([]string, 5, 5)
fmt.Printf("len(%d) cap(%d)\n", len(l), cap(l))
}
fantom
list := [,]
class SolutionXX
{
Void main()
{
list := [,]
}
}
Submit a new solution for
ruby
,
erlang
,
clojure
,
go
...
There are 19 other solutions in
additional
languages (
cpp
,
csharp
,
fsharp
,
groovy
...)