Skip to content

Commit 0e66b9a

Browse files
committed
fix comments
1 parent 6b48b9d commit 0e66b9a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555

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

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

6060
## Library changes
6161

lib/pure/sugar.nim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,9 +384,9 @@ proc splitDefinition*(def: NimNode): tuple[lhs: NimNode, rhs: NimNode, exported:
384384
expectKind(result.lhs, nnkIdent)
385385

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

0 commit comments

Comments
 (0)