26
26
Like the `quote` keyword but doesn't insert line numbers from the construction
27
27
site. e.g. compare `@q begin end` with `quote end`. Line numbers of interpolated
28
28
expressions are preserverd.
29
+
30
+ See also: [`rmlines`](@ref)
29
31
"""
30
32
macro q (ex)
31
33
Expr (:quote , striplines (ex))
@@ -65,6 +67,8 @@ To work with nested blocks:
65
67
```julia
66
68
prewalk(rmlines, ex)
67
69
```
70
+
71
+ See also: [`@q`](@ref)
68
72
"""
69
73
rmlines (x) = x
70
74
function rmlines (x:: Expr )
@@ -108,8 +112,9 @@ walk(x::Expr, inner, outer) = outer(Expr(x.head, map(inner, x.args)...))
108
112
postwalk(f, expr)
109
113
110
114
Applies `f` to each node in the given expression tree, returning the result.
111
- `f` sees expressions *after* they have been transformed by the walk. See also
112
- `prewalk`.
115
+ `f` sees expressions *after* they have been transformed by the walk.
116
+
117
+ See also: [`prewalk`](@ref).
113
118
"""
114
119
postwalk (f, x) = walk (x, x -> postwalk (f, x), f)
115
120
@@ -121,7 +126,7 @@ Applies `f` to each node in the given expression tree, returning the result.
121
126
walk will be applied to whatever `f` returns.
122
127
123
128
This makes `prewalk` somewhat prone to infinite loops; you probably want to try
124
- `postwalk` first.
129
+ [ `postwalk`](@ref) first.
125
130
"""
126
131
prewalk (f, x) = walk (f (x), x -> prewalk (f, x), identity)
127
132
@@ -282,6 +287,8 @@ all_params = [get(dict, :params, [])..., get(dict, :whereparams, [])...]
282
287
\$ (dict[:body])
283
288
end)
284
289
```
290
+
291
+ See also: [`combinedef`](@ref)
285
292
"""
286
293
function splitdef (fdef)
287
294
error_msg = " Not a function definition: $(repr (fdef)) "
306
313
"""
307
314
combinedef(dict::Dict)
308
315
309
- `combinedef` is the inverse of `splitdef`. It takes a splitdef-like Dict
310
- and returns a function definition. """
316
+ `combinedef` is the inverse of [`splitdef`](@ref). It takes a `splitdef`-like Dict
317
+ and returns a function definition.
318
+ """
311
319
function combinedef (dict:: Dict )
312
320
rtype = get (dict, :rtype , nothing )
313
321
params = get (dict, :params , [])
347
355
"""
348
356
combinearg(arg_name, arg_type, is_splat, default)
349
357
350
- `combinearg` is the inverse of `splitarg`. """
358
+ `combinearg` is the inverse of [`splitarg`](@ref).
359
+ """
351
360
function combinearg (arg_name, arg_type, is_splat, default)
352
361
a = arg_name=== nothing ? :(:: $arg_type ) : :($ arg_name:: $arg_type )
353
362
a2 = is_splat ? Expr (:... , a) : a
@@ -376,6 +385,8 @@ Match function arguments (whether from a definition or a function call) such as
376
385
(:y, :Any, false, nothing)
377
386
(:args, :Any, true, nothing)
378
387
```
388
+
389
+ See also: [`combinearg`](@ref)
379
390
"""
380
391
function splitarg (arg_expr)
381
392
splitvar (arg) =
0 commit comments