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

Cannot splice Var in quotation #6

Closed
sachinbjohn opened this issue Dec 9, 2016 · 3 comments
Closed

Cannot splice Var in quotation #6

sachinbjohn opened this issue Dec 9, 2016 · 3 comments

Comments

@sachinbjohn
Copy link
Member

val v = __newVar[Int](unit(1))
ir"println($v)"
@LPTK
Copy link
Member

LPTK commented Dec 9, 2016

Squid sees variables as members of squid.lib.Var, therefore you have to write ir"println($v.!)". Look at the examples I gave you.

PS: can you paste the errors you get with the offending code in the future?

@LPTK LPTK closed this as completed Dec 9, 2016
@amirsh
Copy link
Member

amirsh commented Dec 9, 2016

@LPTK I'm not sure the syntax you came up with is a good idea. It's true that this is the syntax for working with references in ML, but I don't think that using it as Scala code is a good idea.
Ideally the main learning barrier of quasiquotes for a Scala user should only be quoting and splicing.

@amirsh amirsh reopened this Dec 9, 2016
@LPTK
Copy link
Member

LPTK commented Dec 9, 2016

@amirsh Feel free to contribute an enhancement to the quasiquote API. This is not a blocker.

@LPTK LPTK closed this as completed Jan 30, 2018
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