Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
scabug opened this issue Dec 13, 2013 · 3 comments
Closed
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Dec 13, 2013

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.

@scabug
Copy link
Author

scabug commented Dec 13, 2013

Imported From: https://issues.scala-lang.org/browse/SI-8078?orig=1
Reporter: @densh
Affected Versions: 2.11.0-M7

@scabug
Copy link
Author

scabug commented Apr 24, 2014

@DarkDimius said:
I'm interested in getting this implemented.
The rationale is when macro is going to define many in-line variables, I'd prefer to create a single freshName for prefix, instead of creating a freshName for every variable.

@SethTisue
Copy link
Member

closing all quasiquotes tickets; see #10755

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants