From ac5dff2e04f4f8e2c4aa6537e89d26c2ca09b946 Mon Sep 17 00:00:00 2001 From: "Lynn C. Rees" Date: Wed, 15 Nov 2017 13:58:11 -0700 Subject: Change expr/stmt in examples to untyped (#6734) --- examples/talk/formatoptimizer.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/talk/formatoptimizer.nim') diff --git a/examples/talk/formatoptimizer.nim b/examples/talk/formatoptimizer.nim index db11d112d..104214e19 100644 --- a/examples/talk/formatoptimizer.nim +++ b/examples/talk/formatoptimizer.nim @@ -5,7 +5,7 @@ import macros proc invalidFormatString() = echo "invalidFormatString" -template formatImpl(handleChar: expr) = +template formatImpl(handleChar: untyped) = var i = 0 while i < f.len: if f[i] == '$': @@ -24,11 +24,11 @@ template formatImpl(handleChar: expr) = i += 1 proc `%`*(f: string, a: openArray[string]): string = - template identity(x: expr): expr = x + template identity(x: untyped): untyped = x result = "" formatImpl(identity) -macro optFormat{`%`(f, a)}(f: string{lit}, a: openArray[string]): expr = +macro optFormat{`%`(f, a)}(f: string{lit}, a: openArray[string]): untyped = result = newNimNode(nnkBracket) #newCall("&") let f = f.strVal -- cgit 1.4.1-2-gfad0