June 2018 Update

This commit is contained in:
Ingy döt Net 2018-06-22 20:57:24 +00:00
parent ba8067c3b7
commit 22f33d4004
5278 changed files with 84726 additions and 14379 deletions

View file

@ -1,4 +1,4 @@
proc `^`*[T: SomeInteger](base: T, exp: T): T =
proc `^`*[T: SomeInteger](base, exp: T): T =
var (base, exp) = (base, exp)
result = 1

View file

@ -1,7 +1,7 @@
template times(x: expr, y: stmt): stmt =
template times(x, y: untyped): untyped =
for i in 1..x:
y
10.times: # or times 10:
10.times: # or times 10: or times(10):
echo "hi"
echo "bye"

View file

@ -0,0 +1,11 @@
import scala.language.experimental.macros
import scala.reflect.macros.Context
object Macros {
def impl(c: Context) = {
import c.universe._
c.Expr[Unit](q"""println("Hello World")""")
}
def hello: Unit = macro impl
}