We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6225d9a commit 43cdc58Copy full SHA for 43cdc58
1 file changed
base/docs/basedocs.jl
@@ -1400,8 +1400,20 @@ kw"struct"
1400
mutable struct
1401
1402
`mutable struct` is similar to [`struct`](@ref), but additionally allows the
1403
-fields of the type to be set after construction. See the manual section on
1404
-[Composite Types](@ref) for more information.
+fields of the type to be set after construction.
+
1405
+Individual fields of a mutable struct can be marked as `const` to make them immutable:
1406
1407
+```julia
1408
+mutable struct Baz
1409
+ a::Int
1410
+ const b::Float64
1411
+end
1412
+```
1413
+!!! compat "Julia 1.8"
1414
+ The `const` keyword for fields of mutable structs requires at least Julia 1.8.
1415
1416
+See the manual section on [Composite Types](@ref) for more information.
1417
"""
1418
kw"mutable struct"
1419
0 commit comments