Created
March 2, 2014 15:29
-
-
Save aoiroaoino/9308248 to your computer and use it in GitHub Desktop.
for文で三角形
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scala> import scala.language.experimental.macros | |
import scala.language.experimental.macros | |
scala> import scala.reflect.macros.Context | |
import scala.reflect.macros.Context | |
scala> def for_impl(c: Context) = c.universe.reify(println("*\n**\n***\n****\n***\n**\n*")) | |
for_impl: (c: scala.reflect.macros.Context)c.universe.Expr[Unit] | |
scala> def for文 = macro for_impl | |
for文: Unit | |
scala> for文 | |
* | |
** | |
*** | |
**** | |
*** | |
** | |
* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment