Skip to content

Commit 3325f56

Browse files
authored
Switched to kwdef from Base (#138)
* Switched to kwdef from Base * slight formatting change for kwdef
1 parent 1f782b0 commit 3325f56

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lectures/getting_started_julia/introduction_to_types.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -483,12 +483,13 @@ The code works, and is equivalent in performance to a `NamedTuple`, but is more
483483

484484
There is no way to avoid learning parametric types to achieve high performance code.
485485

486-
However, the other issue where constructor arguments are error-prone, can be remedied with the `Parameters.jl` library.
486+
However, the other issue where constructor arguments are error-prone can be
487+
remedied with the `@kwdef` macro from `Base`.
487488

488489
```{code-cell} julia
489-
using Parameters
490+
using Base: @kwdef
490491
491-
@with_kw struct Foo5
492+
@kwdef struct Foo5
492493
a::Float64 = 2.0 # adds default value
493494
b::Int64
494495
c::Vector{Float64}

0 commit comments

Comments
 (0)