# Pre-SIP: A Syntax for Collection Literals

**URL:** <https://contributors.scala-lang.org/t/pre-sip-a-syntax-for-collection-literals/6990>\
**Category:** Scala Improvement Process\
**Created:** [January 15, 2025, 11:31am UTC](https://contributors.scala-lang.org/t/pre-sip-a-syntax-for-collection-literals/6990 "2025-01-15T11:31:38Z")\
**Posts on this page:** 1\
**Showing post:** 178

<div class="post-metadata">

**Author:** ![rjolly](https://contributors.scala-lang.org/user_avatar/contributors.scala-lang.org/rjolly/32/1737_2.png) [@rjolly](https://contributors.scala-lang.org/u/rjolly)\
**Post date:** [January 23, 2025, 3:40pm UTC](https://contributors.scala-lang.org/t/pre-sip-a-syntax-for-collection-literals/6990/178 "2025-01-23T15:40:45Z")

</div>

On reflexion, I now think writing named tuples with square brackets might not be that crazy after all. All we have to do is recognize that the concept has nothing to do with tuples and everything to do with case class literals or _records_ and stop shoehorning one concept into the other. So, assuming it’s not too late for redesigning named tuples : rename them as records, write them with square brackets and (as per Martin’s addition) use them as case class literals. Leave unnamed tuples alone whose pitfalls (no syntax for arity 0, 1 and clashes in general with parens notation used for expression delimitation) were never a problem until now. For one thing this would solve the question [whether or not named tuples should be convertible to unnamed and in what direction](https://contributors.scala-lang.org/t/pre-sip-named-tuples/6403/239). And we would get coherent syntax for data values, with repeated and optional parameters and everything:

```scala
val b1: BuildDescription = [
  declarationMap = true,
  esModuleInterop = true,
  baseUrl = ".",
  rootDir = "typescript",
  declaration = true,
  outDir = pubBundledOut,
  deps = [junitInterface, commonsIo],
  plugins = [
    [transform = "typescript-transform-paths"],
    [ transform = "typescript-transform-paths",
      afterDeclarations = true
    ]
  ],
  aliases = ["someValue", "some-value", "a value"],
  moduleResolution = "node",
  module = "CommonJS",
  target = "ES2020"
]

```

What do you think?  
Edit: and with records we could do away with pattern matching and avoid the ridiculous `val (x = x, y = y) = ...`  
And: if this change is ever incorporated, at the same time would it be possible to de-experimentalize [generic number literals](https://github.com/scala/improvement-proposals/pull/85) so that Vector[BigInt] parses seamlessly for the mathematicians’ happiness.

---

_[View the full topic](https://contributors.scala-lang.org/t/pre-sip-a-syntax-for-collection-literals/6990)._
