Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour committed Jan 23, 2020
1 parent 6b48b9d commit 0e66b9a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

- Added `os.isRelativeTo` to tell whether a path is relative to another

- Added `sugar.byAddr` allowing a ref syntax for lvalue expressions
- Added `sugar.byAddr` allowing a reference syntax for lvalue expressions, analog to C++ `auto& a = expr`.

## Library changes

Expand Down
6 changes: 3 additions & 3 deletions lib/pure/sugar.nim
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,9 @@ proc splitDefinition*(def: NimNode): tuple[lhs: NimNode, rhs: NimNode, exported:
expectKind(result.lhs, nnkIdent)

macro byAddr*(def: untyped): untyped {.since: (1,1).} =
## Defines a ref alias for lvalue expressions. The expression is evaluated
## only once, and any side effects will only be evaluated once, at declaration
## time.
## Defines a reference syntax for lvalue expressions, analog to C++ `auto& a = expr`.
## The expression is evaluated only once, and any side effects will only be
## evaluated once, at declaration time.
runnableExamples:
var x = @[1,2,3]
byAddr: x1=x[1]
Expand Down

0 comments on commit 0e66b9a

Please sign in to comment.