liufengyun / gestalt

gestalt : portable and solid macros for Scala
https://github.com/scalacenter/macros
31 stars 3 forks source link

a simple solution to hygiene problem #81

Closed liufengyun closed 7 years ago

liufengyun commented 7 years ago

This is a simple while practical solution to the hygiene problem: it still allows programmers to do the hack if scala.gestalt.options.unsafe is imported. By default, only fully-qualified name or symbol-based name is supported.

When scala supports literal types, we can do better with the API:

      def Ident(name: "_root_"): Tree
      def Ident(name: "scala")(implcit dummy: C): Tree
liufengyun commented 7 years ago

It's really nice that the implementation of monadless is hygienic, and optional is partly hygienic.