Skip to content

Commit

Permalink
Merge pull request #17 from Sciemon/patch-1
Browse files Browse the repository at this point in the history
typo
  • Loading branch information
VaclavMacha authored Jan 30, 2022
2 parents db490df + c20a35e commit dd94c62
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/src/lecture_06/currencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ julia> b = BankAccount("Paul", Euro)
BankAccount{Euro}("Paul", Currency[Euro(0.0)])
```

First, we observe that we use the `Euro` type (and not its instance) to instantiate the `BankAccount` type. The reason is the definition of the inner constructor for `BankAccount`, where the type annotation is `::Type{<:Currency}`. This is in contrast with `::Currency`. The former requires that the argument is a type, while the former needs an instance.
First, we observe that we use the `Euro` type (and not its instance) to instantiate the `BankAccount` type. The reason is the definition of the inner constructor for `BankAccount`, where the type annotation is `::Type{<:Currency}`. This is in contrast with `::Currency`. The former requires that the argument is a type, while the latter needs an instance.

Second, `BankAccount` is a parametric type, as can be seen from `BankAccount{Euro}`. In our example, this parameter plays the role of the primary account currency.

Expand Down

0 comments on commit dd94c62

Please sign in to comment.