@@ -1118,17 +1118,21 @@ function show_nd(io::IO, a::AbstractArray, limit, print_matrix, label_slices)
1118
1118
cartesianmap (print_slice, tail)
1119
1119
end
1120
1120
1121
- function whos (m:: Module , pattern:: Regex )
1122
- for v in sort (names (m))
1123
- s = string (v)
1124
- if isdefined (m,v) && ismatch (pattern, s)
1125
- println (rpad (s, 30 ), summary (eval (m,v)))
1121
+ function whos (m:: Module , pattern:: Regex ; filter= [])
1122
+ filtertypes = applicable (start, filter) ?
1123
+ filter : [filter]
1124
+ filtertest (var) = ! any (T -> typeof (var) <: T , filtertypes)
1125
+ for n in sort (names (m))
1126
+ s = string (n)
1127
+ v = eval (m,n)
1128
+ if isdefined (m,n) && ismatch (pattern, s) && filtertest (v)
1129
+ println (rpad (s, 30 ), summary (v))
1126
1130
end
1127
1131
end
1128
1132
end
1129
- whos () = whos (r" " )
1130
- whos (m:: Module ) = whos (m, r" " )
1131
- whos (pat:: Regex ) = whos (current_module (), pat)
1133
+ whos (;filter = Module ) = whos (r" " ; filter = filter )
1134
+ whos (m:: Module ; filter = [] ) = whos (m, r" " ; filter = filter )
1135
+ whos (pat:: Regex ; filter = [] ) = whos (current_module (), pat; filter = filter )
1132
1136
1133
1137
# global flag for limiting output
1134
1138
# TODO : this should be replaced with a better mechanism. currently it is only
0 commit comments