liufengyun / gestalt

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

assumptions about macro usage #85

Closed liufengyun closed 7 years ago

liufengyun commented 7 years ago

As stated in the README, one design philosophy of gestalt is to make more assumptions of macro usage. I'll try to document some such assumptions (and optionally justify by reasoning and/or evidence).

Some of the assumptions is open for debate, take them as hypothesis. The hypothesis are written in descriptive mode, but should be read as both descriptive and prescriptive.

Macros never match modifiers exactly

No extractors are required for type trees

No extractors are required for pattern trees

No extractors are required for For and PatDef

No extractors are needed for this and super

No extractors are needed for Self

No extractors are needed for parent definition list

No extractors are needed for import statements

Usage of Extractors in patterns is always better than using quasiquote patterns

Typed trees only need one abstract type, except for the reason of extension methods

liufengyun commented 7 years ago

Close now, detailed arguments are given in section 5.4 of the paper.