Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
songnari committed Dec 1, 2017
2 parents 0c78bc0 + 3fc96db commit 9a1ed5f
Show file tree
Hide file tree
Showing 53 changed files with 594 additions and 153 deletions.
2 changes: 1 addition & 1 deletion codex/devdocs/llvm.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LLVM for Julia.

## Overview of Julia to LLVM Interface

Julia statically links in LLVM by default. Build with `USE_LLVM_SHLIB=1` to link dynamically.
Julia dynamically links against LLVM by default. Build with `USE_LLVM_SHLIB=0` to link statically.

The code for lowering Julia AST to LLVM IR or interpreting it directly is in directory `src/`.

Expand Down
4 changes: 2 additions & 2 deletions codex/devdocs/offset-arrays.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ end

### Allocating storage using generalizations of `similar`

Storage is often allocated with `Array{Int}(dims)` or `similar(A, args...)`. When the result needs
Storage is often allocated with `Array{Int}(uninitialized, dims)` or `similar(A, args...)`. When the result needs
to match the indices of some other array, this may not always suffice. The generic replacement
for such patterns is to use `similar(storagetype, shape)`. `storagetype` indicates the kind of
underlying "conventional" behavior you'd like, e.g., `Array{Int}` or `BitArray` or even `dims->zeros(Float32, dims)`
Expand All @@ -109,7 +109,7 @@ Let's walk through a couple of explicit examples. First, if `A` has conventional
`similar(Array{Int}, indices(A))` would end up calling `Array{Int}(size(A))`, and thus return
an array. If `A` is an `AbstractArray` type with unconventional indexing, then `similar(Array{Int}, indices(A))`
should return something that "behaves like" an `Array{Int}` but with a shape (including indices)
that matches `A`. (The most obvious implementation is to allocate an `Array{Int}(size(A))` and
that matches `A`. (The most obvious implementation is to allocate an `Array{Int}(uninitialized, size(A))` and
then "wrap" it in a type that shifts the indices.)

Note also that `similar(Array{Int}, (indices(A, 2),))` would allocate an `AbstractVector{Int}`
Expand Down
2 changes: 1 addition & 1 deletion codex/devdocs/subarrays.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ of the parent array, whereas for `S2` one needs to apply them to the second and
approach to indexing would be to do the type-analysis at runtime:

```julia
parentindexes = Array{Any}(0)
parentindexes = Vector{Any}()
for thisindex in S.indexes
...
if isa(thisindex, Int)
Expand Down
1 change: 1 addition & 0 deletions codex/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
* [Shared Arrays](@ref)
* [Base64](@ref)
* [File Events](@ref lib-filewatching)
* [Iterative Eigensolvers](@ref lib-itereigen)

## Developer Documentation

Expand Down
40 changes: 20 additions & 20 deletions codex/manual/arrays.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,26 +50,26 @@ omitted it will default to [`Float64`](@ref).

| Function | Description |
|:---------------------------------- |:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`Array{T}(dims...)`](@ref) | an uninitialized dense [`Array`](@ref) |
| [`zeros(T, dims...)`](@ref) | an `Array` of all zeros |
| [`zeros(A)`](@ref) | an array of all zeros with the same type, element type and shape as `A` |
| [`ones(T, dims...)`](@ref) | an `Array` of all ones |
| [`ones(A)`](@ref) | an array of all ones with the same type, element type and shape as `A` |
| [`trues(dims...)`](@ref) | a [`BitArray`](@ref) with all values `true` |
| [`trues(A)`](@ref) | a `BitArray` with all values `true` and the same shape as `A` |
| [`falses(dims...)`](@ref) | a `BitArray` with all values `false` |
| [`falses(A)`](@ref) | a `BitArray` with all values `false` and the same shape as `A` |
| [`reshape(A, dims...)`](@ref) | an array containing the same data as `A`, but with different dimensions |
| [`copy(A)`](@ref) | copy `A` |
| [`deepcopy(A)`](@ref) | copy `A`, recursively copying its elements |
| [`similar(A, T, dims...)`](@ref) | an uninitialized array of the same type as `A` (dense, sparse, etc.), but with the specified element type and dimensions. The second and third arguments are both optional, defaulting to the element type and dimensions of `A` if omitted. |
| [`reinterpret(T, A)`](@ref) | an array with the same binary data as `A`, but with element type `T` |
| [`rand(T, dims...)`](@ref) | an `Array` with random, iid [^1] and uniformly distributed values in the half-open interval ``[0, 1)`` |
| [`randn(T, dims...)`](@ref) | an `Array` with random, iid and standard normally distributed values |
| [`Matrix{T}(I, m, n)`](@ref) | `m`-by-`n` identity matrix |
| [`linspace(start, stop, n)`](@ref) | range of `n` linearly spaced elements from `start` to `stop` |
| [`fill!(A, x)`](@ref) | fill the array `A` with the value `x` |
| [`fill(x, dims...)`](@ref) | an `Array` filled with the value `x` |
| [`Array{T}(uninitialized, dims...)`](@ref) | an uninitialized dense [`Array`](@ref) |
| [`zeros(T, dims...)`](@ref) | an `Array` of all zeros |
| [`zeros(A)`](@ref) | an array of all zeros with the same type, element type and shape as `A` |
| [`ones(T, dims...)`](@ref) | an `Array` of all ones |
| [`ones(A)`](@ref) | an array of all ones with the same type, element type and shape as `A` |
| [`trues(dims...)`](@ref) | a [`BitArray`](@ref) with all values `true` |
| [`trues(A)`](@ref) | a `BitArray` with all values `true` and the same shape as `A` |
| [`falses(dims...)`](@ref) | a `BitArray` with all values `false` |
| [`falses(A)`](@ref) | a `BitArray` with all values `false` and the same shape as `A` |
| [`reshape(A, dims...)`](@ref) | an array containing the same data as `A`, but with different dimensions |
| [`copy(A)`](@ref) | copy `A` |
| [`deepcopy(A)`](@ref) | copy `A`, recursively copying its elements |
| [`similar(A, T, dims...)`](@ref) | an uninitialized array of the same type as `A` (dense, sparse, etc.), but with the specified element type and dimensions. The second and third arguments are both optional, defaulting to the element type and dimensions of `A` if omitted. |
| [`reinterpret(T, A)`](@ref) | an array with the same binary data as `A`, but with element type `T` |
| [`rand(T, dims...)`](@ref) | an `Array` with random, iid [^1] and uniformly distributed values in the half-open interval ``[0, 1)`` |
| [`randn(T, dims...)`](@ref) | an `Array` with random, iid and standard normally distributed values |
| [`Matrix{T}(I, m, n)`](@ref) | `m`-by-`n` identity matrix |
| [`linspace(start, stop, n)`](@ref) | range of `n` linearly spaced elements from `start` to `stop` |
| [`fill!(A, x)`](@ref) | fill the array `A` with the value `x` |
| [`fill(x, dims...)`](@ref) | an `Array` filled with the value `x` |

[^1]: *iid*, independently and identically distributed.

Expand Down
2 changes: 1 addition & 1 deletion codex/manual/constructors.md
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ one type to another, you should probably define a `convert` method instead.

On the other hand, if your constructor does not represent a lossless conversion, or doesn't represent
"conversion" at all, it is better to leave it as a constructor rather than a `convert` method.
For example, the `Array{Int}()` constructor creates a zero-dimensional `Array` of the type `Int`,
For example, the `Array{Int,0}(uninitialized)` constructor creates a zero-dimensional `Array` of the type `Int`,
but is not really a "conversion" from `Int` to an `Array`.

## Outer-only constructors
Expand Down
4 changes: 2 additions & 2 deletions codex/manual/dates.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ julia> for i = 1:10^5
end
```

A full suite of parsing and formatting tests and examples is available in [`tests/dates/io.jl`](https://github.com/JuliaLang/julia/blob/master/test/dates/io.jl).
A full suite of parsing and formatting tests and examples is available in [`stdlib/Dates/test/io.jl`](https://github.com/JuliaLang/julia/blob/master/stdlib/Dates/test/io.jl).

## Durations/Comparisons

Expand Down Expand Up @@ -503,7 +503,7 @@ julia> filter(dr) do x
2014-11-11
```

Additional examples and tests are available in [`test/dates/adjusters.jl`](https://github.com/JuliaLang/julia/blob/master/test/dates/adjusters.jl).
Additional examples and tests are available in [`stdlib/Dates/test/adjusters.jl`](https://github.com/JuliaLang/julia/blob/master/stdlib/Dates/test/adjusters.jl).

## Period Types

Expand Down
13 changes: 7 additions & 6 deletions codex/manual/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -566,12 +566,13 @@ julia> gvar_self = "Node1"
julia> remotecall_fetch(()->gvar_self, 2)
"Node1"
julia> remotecall_fetch(whos, 2)
From worker 2: Base 41762 KB Module
From worker 2: Core 27337 KB Module
From worker 2: Foo 2477 bytes Module
From worker 2: Main 46191 KB Module
From worker 2: gvar_self 13 bytes String
julia> remotecall_fetch(varinfo, 2)
name size summary
––––––––– –––––––– –––––––
Base Module
Core Module
Main Module
gvar_self 13 bytes String
```

This does not apply to `function` or `type` declarations. However, anonymous functions bound to global
Expand Down
10 changes: 8 additions & 2 deletions codex/manual/interacting-with-julia.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,14 @@ to do so).
| End, `^E` | Move to end of line |
| Up arrow, `^P` | Move up one line (or change to the previous history entry that matches the text before the cursor) |
| Down arrow, `^N` | Move down one line (or change to the next history entry that matches the text before the cursor) |
| Shift-Arrow Key | Move cursor according to the direction of the Arrow key, while activating the region ("shift selection") |
| Page-up, `meta-P` | Change to the previous history entry |
| Page-down, `meta-N` | Change to the next history entry |
| `meta-<` | Change to the first history entry (of the current session if it is before the current position in history) |
| `meta->` | Change to the last history entry |
| `^-Space` | Set the "mark" in the editing region |
| `^-Space` | Set the "mark" in the editing region (and de-activate the region if it's active) |
| `^-Space ^-Space` | Set the "mark" in the editing region and make the region "active", i.e. highlighted |
| `^G` | De-activate the region (i.e. make it not highlighted) |
| `^X^X` | Exchange the current position with the mark |
| **Editing** |   |
| Backspace, `^H` | Delete the previous character |
Expand All @@ -179,12 +182,15 @@ to do so).
| `^Y` | "Yank" insert the text from the kill ring |
| `meta-y` | Replace a previously yanked text with an older entry from the kill ring |
| `^T` | Transpose the characters about the cursor |
| `meta-Up arrow` | Transpose current line with line above |
| `meta-Down arrow` | Transpose current line with line below |
| `meta-u` | Change the next word to uppercase |
| `meta-c` | Change the next word to titlecase |
| `meta-l` | Change the next word to lowercase |
| `^/`, `^_` | Undo previous editing action |
| `^Q` | Write a number in REPL and press `^Q` to open editor at corresponding stackframe or method |

| `meta-Left Arrow` | indent the current line on the left |
| `meta-Right Arrow` | indent the current line on the right |


### Customizing keybindings
Expand Down
Loading

0 comments on commit 9a1ed5f

Please sign in to comment.