Skip to content

Commit

Permalink
fix #28277, replace type with struct in docs
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
JeffBezanson committed Jul 26, 2018
1 parent 2cb04e0 commit 38c8a03
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion doc/src/manual/calling-c-and-fortran-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ end
```

The meaning of prefix `&` is not quite the same as in C. In particular, any changes to the referenced
variables will not be visible in Julia unless the type is mutable (declared via `type`). However,
variables will not be visible in Julia unless the type is mutable (declared via `mutable struct`). However,
even for immutable structs it will not cause any harm for called functions to attempt such modifications
(that is, writing through the passed pointers). Moreover, `&` may be used with any expression,
such as `&0` or `&f(x)`.
Expand Down
4 changes: 2 additions & 2 deletions doc/src/manual/constructors.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ julia> Point(x::T, y::T) where {T<:Real} = Point{T}(x,y);

Notice that each definition looks like the form of constructor call that it handles.
The call `Point{Int64}(1,2)` will invoke the definition `Point{T}(x,y)` inside the
`type` block.
`struct` block.
The outer constructor declaration, on the other hand, defines a
method for the general `Point` constructor which only applies to pairs of values of the same real
type. This declaration makes constructor calls without explicit type parameters, like `Point(1,2)`
Expand Down Expand Up @@ -534,7 +534,7 @@ The problem is that we want `S` to be a larger type than `T`, so that we can sum
with less information loss. For example, when `T` is [`Int32`](@ref), we would like `S` to
be [`Int64`](@ref). Therefore we want to avoid an interface that allows the user to construct
instances of the type `SummedArray{Int32,Int32}`. One way to do this is to provide a
constructor only for `SummedArray`, but inside the `type` definition block to suppress
constructor only for `SummedArray`, but inside the `struct` definition block to suppress
generation of default constructors:

```jldoctest
Expand Down
2 changes: 1 addition & 1 deletion doc/src/manual/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ Main Module
gvar_self 13 bytes String
```

This does not apply to `function` or `type` declarations. However, anonymous functions bound to global
This does not apply to `function` or `struct` declarations. However, anonymous functions bound to global
variables are serialized as can be seen below.

```julia-repl
Expand Down
2 changes: 1 addition & 1 deletion doc/src/manual/noteworthy-differences.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ may trip up Julia users accustomed to MATLAB:
* In both Julia and MATLAB, the variable `ans` is set to the value of the last expression issued
in an interactive session. In Julia, unlike MATLAB, `ans` is not set when Julia code is run in
non-interactive mode.
* Julia's `type`s do not support dynamically adding fields at runtime, unlike MATLAB's `class`es.
* Julia's `struct`s do not support dynamically adding fields at runtime, unlike MATLAB's `class`es.
Instead, use a [`Dict`](@ref).
* In Julia each module has its own global scope/namespace, whereas in MATLAB there is just one global
scope.
Expand Down

0 comments on commit 38c8a03

Please sign in to comment.