# Idea how to fit collection literals into language

**URL:** <https://discuss.kotlinlang.org/t/idea-how-to-fit-collection-literals-into-language/7349>\
**Category:** Language Design\
**Created:** [April 8, 2018, 8:23am UTC](https://discuss.kotlinlang.org/t/idea-how-to-fit-collection-literals-into-language/7349 "2018-04-08T08:23:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Konstantin-Khvan](https://avatars.discourse-cdn.com/v4/letter/k/4af34b/32.png) [@Konstantin-Khvan](https://discuss.kotlinlang.org/u/Konstantin-Khvan)\
**Post date:** [April 8, 2018, 8:23am UTC](https://discuss.kotlinlang.org/t/idea-how-to-fit-collection-literals-into-language/7349/1 "2018-04-08T08:23:57Z")

</div>

Sorry if there was this one already 🙂  
Consider introducing operators createList, createMap etc  
Provide Default implementation which will be imported  
Since they are operators user can override them on per file(just don’t import default one) and per type basis

```
fun GlobalScopeOrSmthng.createList(vararg elements:Any?) = listof(*elements)
fun GlobalScopeOrSmthng.createList(objectToSpread:Any?, vararg elements:Any?) = *objectToSpread +listof(*elements)

```

.

```
import GlobalSugar.createList

fun main(args: Array<String>) {
	val list = [1, 2, 3, 4, 5]
	val listConcat = [*list, 6, 7, 8, 9]
}

```
