Skip to content

Commit a348c72

Browse files
committed
Take out README/REQUIRE
1 parent 705483f commit a348c72

File tree

2 files changed

+1
-49
lines changed

2 files changed

+1
-49
lines changed

README.md

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -124,51 +124,3 @@ typeof(st) == typeof(st2) # true
124124
Furthermore, `reload` cannot reload modules imported via `using`, but `creload`
125125
can.
126126

127-
128-
# Code source
129-
130-
`source(fn::Function)` returns a vector of each `Expr` that defines the methods of `fn`.
131-
This is heuristic; it might miss out on some of fn's methods (though it will warn in that
132-
case). Try `source(Base.which)` for an example.
133-
134-
# Code transformations
135-
136-
`ClobberingReload` now also provides a post-hoc code-transformation utility,
137-
`update_code_revertible`. This is meant for building diagnostic tools, not for everyday
138-
usage. For example, this code adds a counter to every function in the module `AA`:
139-
140-
```julia
141-
using AA, ClobberingReload, MacroTools
142-
143-
counter = fill(0)
144-
function add_counter(fdef)
145-
di = ClobberingReload.splitdef(fdef)
146-
di[:body] = quote $counter .+= 1; $(di[:body]) end
147-
ClobberingReload.combinedef(di)
148-
end
149-
module_update = update_code_revertible(AA) do code
150-
if @capture(code, function name_(args__) body__ end)
151-
# See `?ClobberingReload.splitdef` for a better function-processing utility
152-
:(function $name($(args...))
153-
$counter[] += 1
154-
$(body...)
155-
end)
156-
end
157-
end
158-
module_update() do
159-
# Temporarily apply the update, for the duration of this do-block
160-
AA.f(10)
161-
end
162-
AA.f(10)
163-
164-
println(counter[]) # 1
165-
```
166-
167-
`update_code_revertible(some_function) do code ... end` works the same way, updating the code behind each of the methods of `some_function`.
168-
169-
This functionality is the basis of [TraceCalls.jl](https://github.com/cstjean/TraceCalls.jl). It's a hack, and can fail for any number of reason. Do not rely on this for mission-critical functionality.
170-
171-
Avoid storing the output of `update_code_revertible`, since if the files are modified
172-
and reloaded by `creload` or `Revise.jl`, then the code-update object will be out-of-sync.
173-
A better way to improve runtime is to memoize the result of the code transformation
174-
function.

REQUIRE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
julia 0.5.0
22
MacroTools 0.3.2
3-
Revise
3+

0 commit comments

Comments
 (0)