scala-quasiquotes Questions

1

With Scala2 I could implement a macro and generate types using tq quasiquote syntax, for eg: q""" new Foo { type Bar = ${tq"(..$params)"} } """ I am able ...
Esma asked 26/9, 2022 at 10:24

1

I have an ostensibly simple macro problem that I’ve been banging my head against for a few hours, with no luck. Perhaps someone with more experience can help. I have the following macro: import s...

1

Solved

I have a custom class, A, and I have defined some operations within the class as follows: def +(that: A) = ... def -(that: A) = ... def *(that: A) = ... def +(that: Double) = ... def -(that: Doub...
Paola asked 14/4, 2019 at 23:11

1

I'm trying to call a Shapeless macro from inside a quasiquote with Scala and I'm not getting what I would like to get. My macro doesn't return any errors but it doesn't expand Witness(fieldName) ...
Pave asked 28/7, 2015 at 14:19

1

Solved

Trying quasiquotes for the first time to generically produce new case classes: val universe: scala.reflect.runtime.universe.type = scala.reflect.runtime.universe import universe._ import scala.ref...
Crystalcrystalline asked 5/7, 2016 at 14:11

2

Solved

I was playing with Scala 2.11's new macro features. I wanted to see if I could do the following rewrite: forRange(0 to 10) { i => println(i) } // into val iter = (0 to 10).iterator while (ite...
Archeozoic asked 18/12, 2013 at 18:33

1

Solved

I'm new to scala macros and I spent a couple of days trying to write my very first one. I have a problem with quasiquotes concatenation. There is a list of case clauses, let's say the following: ...
Outrider asked 20/5, 2015 at 7:42

2

I want to transform Scala XML literals with a macro. (Not a string literal with XML but actual XML literals). As far as I understand, XML literals are not actually built into the language on the AS...
Stockholm asked 21/3, 2014 at 12:31

1

Solved

I'm trying to answer this question. Instead of writing: case class Person(name: String, age: Int) { def this() = this("",1) } I thought I'd use macro annotations to expand it from: @Annotatio...

1

Solved

This question is similar in motivation to my previous question (although it's about a problem I ran into in a different context). I can pattern match on a function literal pretty easily without qu...
Oringas asked 1/9, 2013 at 15:40

1

Solved

Quasiquotes are amazing—they make writing macros in Scala hugely less painful, and in my experience they almost always just work exactly as I'd expect. And best of all, they're now available as a p...
Pelican asked 1/9, 2013 at 14:51
1

© 2022 - 2024 — McMap. All rights reserved.