Skip to content

Commit c8655d6

Browse files
authored
Minor fixes for lecture 02 (#8)
1 parent 1310cc9 commit c8655d6

File tree

4 files changed

+300
-247
lines changed

4 files changed

+300
-247
lines changed

docs/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[deps]
2+
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
23
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
34
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
45
DocumenterTools = "35a29f4d-8980-5a13-9543-d66fff28ecb8"

docs/src/lecture_01/lab.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ You can check that it is a subtype of the `Function` abstract type, with the sub
197197
```@repl lab01_base
198198
typeof(polynomial) <: Function
199199
```
200-
These concepts will be expanded further in the type [lecture](@ref type_lecture), however for now note that this construction is quite useful for example if we wanted to create derivative rules for our function `derivativeof(::typeof(polynomial), ...)`.
200+
These concepts will be expanded further in the type [lecture](@ref type_system), however for now note that this construction is quite useful for example if we wanted to create derivative rules for our function `derivativeof(::typeof(polynomial), ...)`.
201201

202202
Looking at mathematical operators `+`, `*`, we can see that in Julia they are also standalone functions.
203203
```@repl lab01_base
@@ -340,7 +340,7 @@ As opposed to the basic definition of `a` type the array is filled with `Float64
340340
typeof(at), eltype(at)
341341
polynomial(at, x)
342342
```
343-
With round brackets over a fixed length vector we get the `Tuple` type, which is so called immutable "array" of a fixed size (its elements cannot be changed, unless initialized from scratch). Each element can be of a different type, but here we have only one and thus the `Tuple` is aliased into `NTuple`. There are some performance benefits for using immutable structure, which will be discussed [later](@ref type_lecture) or [even later](@ref perf_lecture).
343+
With round brackets over a fixed length vector we get the `Tuple` type, which is so called immutable "array" of a fixed size (its elements cannot be changed, unless initialized from scratch). Each element can be of a different type, but here we have only one and thus the `Tuple` is aliased into `NTuple`. There are some performance benefits for using immutable structure, which will be discussed [later](@ref type_system) or [even later](@ref perf_lecture).
344344

345345

346346
Defining `key=value` pairs inside round brackets creates a structure called `NamedTuple`, which has the same properties as `Tuple` and furthermore its elements can be conveniently accessed by dot syntax, e.g. `ant.a₀`.

0 commit comments

Comments
 (0)