@@ -86,7 +86,7 @@ those that are not exported. What would the function call look like?
8686 2 . ` names(Trebuchets, all = true) ` <!-- -correct-->
8787 3 . ` names(Trebuchets, all) `
8888 4 . ` names(Trebuchets; all = true) ` <!-- -correct-->
89- 5 . Answer 2 and 4 <!-- -correct-->
89+ 5 . Both 2 and 4 <!-- -correct-->
9090
9191:::::: solution
9292
@@ -220,7 +220,7 @@ Trebuchets.shoot(5, 0.25pi, 500)[2]
220220114.88494815382731
221221```
222222
223- which means the shot traveled approximately 118 m.
223+ which means the shot traveled approximately 115 m.
224224
225225### Defining functions
226226
@@ -423,7 +423,7 @@ She can also lookup the docstring using the `@doc` macro
423423 See also: length, ndims, eachindex, sizeof.
424424
425425 Examples
426- ≡≡≡≡≡≡≡≡≡≡
426+ ≡≡≡≡≡≡≡≡
427427
428428 julia> A = fill(1, (2,3,4));
429429
@@ -437,25 +437,6 @@ She can also lookup the docstring using the `@doc` macro
437437
438438 Return a tuple with the size of the buffer.
439439
440- size(g, i)
441-
442- Return the number of vertices in g if i=1 or i=2, or 1 otherwise.
443-
444- Examples
445- ≡≡≡≡≡≡≡≡≡≡
446-
447- julia> using Graphs
448-
449- julia> g = cycle_graph(4);
450-
451- julia> size(g, 1)
452- 4
453-
454- julia> size(g, 2)
455- 4
456-
457- julia> size(g, 3)
458- 1
459440```
460441
461442With that information she can now implement this method:
@@ -508,7 +489,7 @@ She looks up the documentation for that function
508489 syntax Type[]. Element values can be specified using Type[a,b,c,...].
509490
510491 Examples
511- ≡≡≡≡≡≡≡≡≡≡
492+ ≡≡≡≡≡≡≡≡
512493
513494 julia> Int8[1, 2, 3]
514495 3-element Vector{Int8}:
@@ -525,13 +506,12 @@ She looks up the documentation for that function
525506 getindex(collection, key...)
526507
527508 Retrieve the value(s) stored at the given key or index within a collection.
528- The syntax a[i,j,...] is converted by the compiler to getindex(a, i, j,
529- ...).
509+ The syntax a[i,j,...] is converted by the compiler to getindex(a, i, j, ...).
530510
531511 See also get, keys, eachindex.
532512
533513 Examples
534- ≡≡≡≡≡≡≡≡≡≡
514+ ≡≡≡≡≡≡≡≡
535515
536516 julia> A = Dict("a" => 1, "b" => 2)
537517 Dict{String, Int64} with 2 entries:
@@ -543,12 +523,21 @@ She looks up the documentation for that function
543523
544524 getindex(A, inds...)
545525
546- Return a subset of array A as specified by inds, where each ind may be, for
547- example, an Int, an AbstractRange, or a Vector. See the manual section on
548- array indexing for details.
526+ Return a subset of array A as selected by the indices inds.
527+
528+ Each index may be any supported index type, such as an Integer,
529+ CartesianIndex, range, or array of supported indices. A : may be used to
530+ select all elements along a specific dimension, and a boolean array (e.g. an
531+ Array{Bool} or a BitArray) may be used to filter for elements where the
532+ corresponding index is true.
533+
534+ When inds selects multiple elements, this function returns a newly allocated
535+ array. To index multiple elements without making a copy, use view instead.
536+
537+ See the manual section on array indexing for details.
549538
550539 Examples
551- ≡≡≡≡≡≡≡≡≡≡
540+ ≡≡≡≡≡≡≡≡
552541
553542 julia> A = [1 2; 3 4]
554543 2×2 Matrix{Int64}:
@@ -568,14 +557,35 @@ She looks up the documentation for that function
568557 3
569558 2
570559 4
560+
561+ julia> getindex(A, 2, 1)
562+ 3
563+
564+ julia> getindex(A, CartesianIndex(2, 1))
565+ 3
566+
567+ julia> getindex(A, :, 2)
568+ 2-element Vector{Int64}:
569+ 2
570+ 4
571+
572+ julia> getindex(A, 2, :)
573+ 2-element Vector{Int64}:
574+ 3
575+ 4
576+
577+ julia> getindex(A, A .> 2)
578+ 2-element Vector{Int64}:
579+ 3
580+ 4
571581
572582 getindex(tree::GitTree, target::AbstractString) -> GitObject
573583
574- Look up target path in the tree, returning a GitObject (a GitBlob in the
575- case of a file, or another GitTree if looking up a directory).
584+ Look up target path in the tree, returning a GitObject (a GitBlob in the case
585+ of a file, or another GitTree if looking up a directory).
576586
577587 Examples
578- ≡≡≡≡≡≡≡≡≡≡
588+ ≡≡≡≡≡≡≡≡
579589
580590 tree = LibGit2.GitTree(repo, "HEAD^{tree}")
581591 readme = tree["README.md"]
@@ -594,13 +604,21 @@ She looks up the documentation for that function
594604
595605 Returns a vector with all elements of array partition A.
596606
607+ getindex(
608+ c::SciMLBase.AbstractClock,
609+ idx
610+ ) -> SciMLBase.IndexedClock
611+
612+
613+ Return a SciMLBase.IndexedClock representing the subset of the time points
614+ that the clock ticked indicated by idx.
615+
597616 v = sd[k]
598617
599618 Argument sd is a SortedDict and k is a key. In an expression, this retrieves
600- the value (v) associated with the key (or KeyError if none). On the
601- left-hand side of an assignment, this assigns or reassigns the value
602- associated with the key. (For assigning and reassigning, see also insert!
603- below.) Time: O(c log n)
619+ the value (v) associated with the key (or KeyError if none). On the left-hand
620+ side of an assignment, this assigns or reassigns the value associated with the
621+ key. (For assigning and reassigning, see also insert! below.) Time: O(c log n)
604622
605623 cb[i]
606624
@@ -612,13 +630,9 @@ She looks up the documentation for that function
612630
613631 getindex(tree, ind)
614632
615- Gets the key present at index ind of the tree. Indexing is done in
616- increasing order of key.
617-
618- g[iter]
633+ Gets the key present at index ind of the tree. Indexing is done in increasing
634+ order of key.
619635
620- Return the subgraph induced by iter. Equivalent to induced_subgraph(g,
621- iter)[1].
622636```
623637
624638Note that the documentation for all methods gets shown and Melissa needs to look
0 commit comments