Measures Concepts
GitHub icon

Lists

Lists - language feature

< >
Example from JavaScript, TypeScript:
const list = [1,2,3]
Example from Python, Cython, Speedie:
myList = [1, 2, 3, 4, 5]
[1, 2, 3]
Example from Go:
myList := []int{1, 2, 3}
Example from Elixir:
my_list = [1, 2, 3, 4, 5]
Example from REBOL, Boron:
my-list: [1 two 3.0 "four"]
Example from Ion:
null.list // A null list value [] // An empty list value [1, 2, 3] // List of three ints [ 1 , two ] // List of an int and a symbol [a , [b]] // Nested list [ 1.2, ] // Trailing comma is legal in Ion (unlike JSON) [ 1, , 2 ] // ERROR: missing element between commas
Example from Bel:
; here is a list of a, b, and c: (a . (b . (c . nil))) ; can be written as (a b c)
Example from Lil:
emptyList = ()
[1 2]
Example from BALGOL:
ARRAY MONTHDAYS(12) = (31,28,31,30,31,30,31,31,30,31,30,31)$

Languages with Lists include JavaScript, Python, JSON, Go, TypeScript, Elixir, GraphQL, REBOL, EDN, JSON5, Cython, Speedie, Ion, janet, Bel, JSONiq, JSON with Comments, Aardvark, Superjson, Jsonnet, Hocon, Lil, Uniform eXchange Format, Boron, BALGOL, fp, hecl

Languages without Lists include progsbase

This question asks: Does the language have lists?

Read more about Lists on the web: 1.

HTML of this page generated by Features.ts

View source

- Build the next great programming language Search Add Language Features Creators Resources About Blog Acknowledgements Queries Stats Sponsor Day 605 feedback@pldb.io Logout