Skip to content

Commit

Permalink
Fix incorrect replacements
Browse files Browse the repository at this point in the history
  • Loading branch information
nalimilan committed Sep 4, 2017
1 parent 29a2b57 commit 416476e
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions base/dates/query.jl
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ daysinyear(dt::TimeType) = 365 + isleapyear(dt)
"""
quarterofyear(dt::TimeType) -> Int
Returns the quarter that `dt` resides in. AbstractRange of value is 1:4.
Returns the quarter that `dt` resides in. Range of value is 1:4.
"""
function quarterofyear(dt::TimeType)
m = month(dt)
Expand All @@ -325,6 +325,6 @@ const QUARTERDAYS = (0, 90, 181, 273)
"""
dayofquarter(dt::TimeType) -> Int
Returns the day of the current quarter of `dt`. AbstractRange of value is 1:92.
Returns the day of the current quarter of `dt`. Range of value is 1:92.
"""
dayofquarter(dt::TimeType) = dayofyear(dt) - QUARTERDAYS[quarterofyear(dt)]
2 changes: 1 addition & 1 deletion base/linalg/dense.jl
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ end
"""
diagind(M, k::Integer=0)
A `AbstractRange` giving the indices of the `k`th diagonal of the matrix `M`.
An `AbstractRange` giving the indices of the `k`th diagonal of the matrix `M`.
# Examples
```jldoctest
Expand Down
2 changes: 1 addition & 1 deletion base/range.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ _colon(::Any, ::Any, start::T, step, stop::T) where {T} =
"""
:(start, [step], stop)
AbstractRange operator. `a:b` constructs a range from `a` to `b` with a step size of 1, and `a:s:b`
Range operator. `a:b` constructs a range from `a` to `b` with a step size of 1, and `a:s:b`
is similar but uses a step size of `s`. These syntaxes call the function `colon`. The colon
is also used in indexing to select whole dimensions.
"""
Expand Down
2 changes: 1 addition & 1 deletion base/simdloop.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function compile(x)
check_body!(x)

var,range = parse_iteration_space(x.args[1])
r = gensym("r") # AbstractRange value
r = gensym("r") # Range value
j = gensym("i") # Iteration variable for outer loop
n = gensym("n") # Trip count for inner loop
i = gensym("i") # Trip index for inner loop
Expand Down
4 changes: 2 additions & 2 deletions doc/src/manual/noteworthy-differences.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ may trip up Julia users accustomed to MATLAB:
- To construct block matrices (concatenating in the first two dimensions), use either [`hvcat()`](@ref)
or combine spaces and semicolons (`[a b; c d]`).
* In Julia, `a:b` and `a:b:c` construct `AbstractRange` objects. To construct a full vector like in MATLAB,
use [`collect(a:b)`](@ref). Generally, there is no need to call `collect` though. `AbstractRange` will
use [`collect(a:b)`](@ref). Generally, there is no need to call `collect` though. An `AbstractRange` object will
act like a normal array in most cases but is more efficient because it lazily computes its values.
This pattern of creating specialized objects instead of full arrays is used frequently, and is
also seen in functions such as [`linspace`](@ref), or with iterators such as `enumerate`, and
Expand Down Expand Up @@ -157,7 +157,7 @@ For users coming to Julia from R, these are some noteworthy differences:
* In Julia, vectors and matrices are concatenated using [`hcat()`](@ref), [`vcat()`](@ref) and
[`hvcat()`](@ref), not `c`, `rbind` and `cbind` like in R.
* In Julia, a range like `a:b` is not shorthand for a vector like in R, but is a specialized `AbstractRange`
that is used for iteration without high memory overhead. To convert a range into a vector, use
object that is used for iteration without high memory overhead. To convert a range into a vector, use
[`collect(a:b)`](@ref).
* Julia's [`max()`](@ref) and [`min()`](@ref) are the equivalent of `pmax` and `pmin` respectively
in R, but both arguments need to have the same dimensions. While [`maximum()`](@ref) and [`minimum()`](@ref)
Expand Down
2 changes: 1 addition & 1 deletion test/dates/ranges.jl
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ end
lastdaysofmonth = [Dates.Date(2014, i, Dates.daysinmonth(2014, i)) for i=1:12]
@test [Date(2014, 1, 31):Dates.Month(1):Date(2015);] == lastdaysofmonth

# AbstractRange addition/subtraction:
# Range addition/subtraction:
let d = Dates.Day(1)
@test (Dates.Date(2000):d:Dates.Date(2001)) + d == (Dates.Date(2000) + d:d:Dates.Date(2001) + d)
@test (Dates.Date(2000):d:Dates.Date(2001)) - d == (Dates.Date(2000) - d:d:Dates.Date(2001) - d)
Expand Down
4 changes: 2 additions & 2 deletions test/ranges.jl
Original file line number Diff line number Diff line change
Expand Up @@ -650,8 +650,8 @@ r = LinSpace(1,4,4)
# comparing and hashing ranges
let
Rs = AbstractRange[1:2, map(Int32,1:3:17), map(Int64,1:3:17), 1:0, 17:-3:0,
0.0:0.1:1.0, map(Float32,0.0:0.1:1.0),
linspace(0, 1, 20), map(Float32, linspace(0, 1, 20))]
0.0:0.1:1.0, map(Float32,0.0:0.1:1.0),
linspace(0, 1, 20), map(Float32, linspace(0, 1, 20))]
for r in Rs
local r
ar = collect(r)
Expand Down

0 comments on commit 416476e

Please sign in to comment.