Small doc improvements for std/with (#17556)
This commit is contained in:
parent
ab57e7f244
commit
9e3960e83d
1 changed files with 4 additions and 3 deletions
|
|
@ -12,15 +12,16 @@
|
||||||
## and https://github.com/nim-lang/RFCs/issues/192 for details leading to this
|
## and https://github.com/nim-lang/RFCs/issues/192 for details leading to this
|
||||||
## particular design.
|
## particular design.
|
||||||
##
|
##
|
||||||
## **Since** version 1.2.
|
## **Since:** version 1.2.
|
||||||
|
|
||||||
import macros, private / underscored_calls
|
import macros, private / underscored_calls
|
||||||
|
|
||||||
macro with*(arg: typed; calls: varargs[untyped]): untyped =
|
macro with*(arg: typed; calls: varargs[untyped]): untyped =
|
||||||
## This macro provides the `chaining`:idx: of function calls.
|
## This macro provides `chaining`:idx: of function calls.
|
||||||
## It does so by patching every call in `calls` to
|
## It does so by patching every call in `calls` to
|
||||||
## use `arg` as the first argument.
|
## use `arg` as the first argument.
|
||||||
## **This evaluates `arg` multiple times!**
|
##
|
||||||
|
## .. caution:: This evaluates `arg` multiple times!
|
||||||
runnableExamples:
|
runnableExamples:
|
||||||
var x = "yay"
|
var x = "yay"
|
||||||
with x:
|
with x:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue