Skip to content

Commit

Permalink
fix test; improve comment
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour committed Jul 26, 2019
1 parent 98f86ce commit 0ea9b3c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/pure/sugar.nim
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,11 @@ when defined(nimHasAlias):
proc aliasImpl[T1, T2](name: T1, expr: T2) {.magic: "Alias".}

template `:=`*(name, expr) =
## Declares `a` as alias of `expr`, which must resolve to a symbol.
## Declares `name` as alias of `expr`, which must resolve to a symbol.
## Works with any symbol, e.g. iterator, template, macro, module, proc etc.
runnableExamples:
echo2:=system.echo
{.push experimental: "aliasSym".}
echo2:=echo
echo2 "hello"
declared2:=system.declared
doAssert declared2(echo2)
Expand Down

0 comments on commit 0ea9b3c

Please sign in to comment.