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

Literal string cannot be used inside interpolated expression #1681

Closed
pao opened this issue Dec 5, 2012 · 4 comments
Closed

Literal string cannot be used inside interpolated expression #1681

pao opened this issue Dec 5, 2012 · 4 comments
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@pao
Copy link
Member

pao commented Dec 5, 2012

julia> asdf = "ghij"
"ghij"

julia> file_path(asdf, "src")
"ghij/src"

julia> "$(file_path(asdf, \"src\"))"
ParseError("missing comma or ) in argument list")

julia> "$(\"a\")"
ParseError("missing separator in tuple")

Is there a trick I haven't picked up or is this actually not currently possible?

Sorry, Jeff, you'll have to continue hating interpolation.

@kmsquire
Copy link
Member

kmsquire commented Dec 5, 2012

Workaround:

julia> "$(file_path(asdf, string(:src)))"
"ghij/src"

@kmsquire
Copy link
Member

kmsquire commented Dec 5, 2012

(Of course, assigning to a variable first is an easier workaround...)

@JeffBezanson
Copy link
Sponsor Member

I never stopped hating string interpolation. This was also filed as #455, and we decided the best fix was to implement triple-quoted strings.

@pao
Copy link
Member Author

pao commented Dec 5, 2012

Ahh, my mistake, closing as dup of #455, then.

@pao pao closed this as completed Dec 5, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants