You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For Revise usage, `max_user_watches >= 65536` is recommended, and more can be helpful; the value of 524288 above is common on modern systems. One can set higher values as needed, e.g.,
170
-
```
170
+
```sh
171
171
$ sudo sysctl fs.inotify.max_user_instances=2048
172
172
```
173
173
After changing these values, it is advised to run Revise's unit tests to see if they pass.
Copy file name to clipboardExpand all lines: docs/src/internals.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ Revise is based on the fact that you can change functions even when
8
8
they are defined in other modules.
9
9
Here's an example showing how you do that manually (without using Revise):
10
10
11
-
```julia
11
+
```julia-repl
12
12
julia> convert(Float64, π)
13
13
3.141592653589793
14
14
@@ -149,14 +149,14 @@ There are several reasons that make this an attractive approach, of which the mo
149
149
- for methods generated by code, the only really reliable mechanism to compute all the signatures is to step through the code that generates the methods. That is performed using [JuliaInterpreter](https://github.com/JuliaDebug/JuliaInterpreter.jl).
150
150
151
151
As an example, suppose the following code is part of your module definition:
152
-
```
152
+
```julia
153
153
for T in (Float16, Float32, Float64)
154
154
@evalsizefloat(x::$T) =sizeof($T)
155
155
end
156
156
```
157
157
!!! tip "clarification"
158
158
This is equivalent to the following explicit definitions:
159
-
```
159
+
```julia
160
160
sizefloat(x::Float16) = 2
161
161
sizefloat(x::Float32) = 4
162
162
sizefloat(x::Float64) = 8
@@ -166,7 +166,7 @@ If you replace the loop with `for T in (Float32, Float64)`, then Revise should d
166
166
167
167
Because lowered code is far simpler than ordinary Julia code, it is much easier to interpret. Let's look briefly at a method definition:
168
168
169
-
```
169
+
```julia
170
170
floatwins(x::AbstractFloat, y::Integer) = x
171
171
```
172
172
@@ -297,7 +297,7 @@ indent(::UInt8) = 4
297
297
If you create this as a mini-package and then say `using Revise, Items`, you can start
298
298
examining internal variables in the following manner:
Copy file name to clipboardExpand all lines: docs/src/limitations.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ These kinds of changes require that you restart your Julia session.
10
10
11
11
During early stages of development, it's quite common to want to change type definitions. You can work around Julia's/Revise's limitations by temporary renaming. We'll illustrate this below, using `write` to be explicit about when updates to the file happen. But in ordinary usage, these are changes you'd likely make with your editor.
12
12
13
-
```julia
13
+
```julia-repl
14
14
julia> using Pkg, Revise
15
15
16
16
julia> Pkg.generate("MyPkg")
@@ -83,7 +83,7 @@ This works as long as the new type name doesn't conflict with an existing name;
83
83
84
84
Once your development has converged on a solution, it's best to switch to the "permanent" name: in the example above, `FooStruct` is a non-constant global variable, and if used internally in a function there will be consequent performance penalties. Switching to the permanent name will force you to restart your session.
Copy file name to clipboardExpand all lines: docs/src/tricks.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
Updating the code in Julia's REPL stdlib requires some extra trickery, because modified method definitions can't be deployed until you exit any currently-running REPL functions, like those handling the prompt that you're using to interact with Julia. A workaround is to create a sub-REPL that you can shut down, and then restart a new one whenever you want to test new code:
0 commit comments