Skip to content

Creation of names prefixed with other names isn't straightforward in quasiquotes #8078

Closed
@scabug

Description

@scabug

Let's say we want to create a bunch of definitions of vals v1...vN with values equal to N:

(1 to N).map { i => 
  val name = TermName(s"v$i")
  q"val $name = $i"
}

What I would like to write instead is:

(1 to N).map { i => q"val v$i = $i" }

Semantics of this is not clear though, especially considering non-name splices into names and requires some brainstorming.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions