makeList (LinkedList)

makeList ( value size -- list )

Creates a LinkedList from multiple copies of a given value.

makeList ( range -- list )

Creates a list from a range, entries of the list will be aliases of entries of the input range.

makeList ( builtinList -- list )

Creates a list from a builtin-list. Entries of the list will be aliases of entries of the input builtin-list.

Arguments

makeArray ( value size -- list )

The

value
to copy into each list element.
size
is the number of elements in the list, integer.

makeArray ( range -- list )

The

range
to alias elements from.

makeArray ( builtinList -- list )

The

builtinList
to alias elements from.

Return values

The resulting

list
.

Complexity

O(size)

Example

"sl/linkedList" useFile a: ("entry" "Entry" "ENTRY") makeList; h:r: a.makeRange.unhead;; b: r makeList; c: "Entry" 5 makeList; a [print "," print TRUE] enum LF print b [print "," print TRUE] enum LF print c [print "," print TRUE] enum
Output:
entry,Entry,ENTRY, Entry,ENTRY, Entry,Entry,Entry,Entry,Entry,