Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into mb/deprecatemultiva…
Browse files Browse the repository at this point in the history
…luenonscalarindexedassignment

* origin/master: (28 commits)
  fix an optimizer bug in `invoke` with non-constant functions (#26301)
  lower top-level statements in such a way that the front-end knows (#26304)
  Make sure Sockets page has h1 header (#26315)
  fix doctests, and make them less prone to errors (#26275)
  FIx intro to manual chapter on types (#26312)
  Add a missing "that" (#26313)
  fix docstring for code_llvm (#26266)
  Remove the examples/ folder (#26153)
  download cert.pem from deps-getall, fixes #24903 (#25344)
  Slight update to doc string for at-enum to refer to instances (#26208)
  performance tweak in reverse(::String) (#26300)
  remove references to `TCPSocket` in Base docstrings (#26298)
  Deprecate adding integers to CartesianIndex (#26284)
  Deprecate conj(::Any), add real(::Missing) and imag(::Missing) (#26288)
  fix #26267, regression in `names` with `imported=false` (#26293)
  fix #25857, `typeinfo` problem in showing arrays with abstract tuple types (#26289)
  Add adjoint(::Missing) method (#25502)
  Use lowered form in logging macro (#26291)
  deprecate bin, oct, dec, hex, and base in favor of `string` and keyword args (#25804)
  deprecate `spawn(cmd)` to `run(cmd, wait=false)` (#26130)
  ...
  • Loading branch information
mbauman committed Mar 5, 2018
2 parents b4d9c6a + c7da537 commit 95a78df
Show file tree
Hide file tree
Showing 187 changed files with 2,339 additions and 3,127 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
/tmp/julia/bin/julia --sysimage-native-code=no -e 'true' &&
/tmp/julia/bin/julia-debug --sysimage-native-code=no -e 'true' &&
pushd /tmp/julia/share/julia/test &&
/tmp/julia/bin/julia --check-bounds=yes runtests.jl all --skip socket | bar -i 30 &&
/tmp/julia/bin/julia --check-bounds=yes runtests.jl all --skip Sockets | bar -i 30 &&
/tmp/julia/bin/julia --check-bounds=yes runtests.jl LibGit2/online Pkg/pkg Pkg3/pkg download &&
popd &&
mkdir /tmp/embedding-test &&
Expand Down
1 change: 0 additions & 1 deletion Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ build_depsbindir := $(build_prefix)/tools
build_libdir := $(build_prefix)/lib
build_libexecdir := $(build_prefix)/libexec
build_datarootdir := $(build_prefix)/share
build_docdir := $(build_datarootdir)/doc/julia
build_mandir := $(build_datarootdir)/man
build_man1dir := $(build_mandir)/man1
build_includedir := $(build_prefix)/include
Expand Down
36 changes: 9 additions & 27 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ all: debug release
# sort is used to remove potential duplicates
DIRS := $(sort $(build_bindir) $(build_depsbindir) $(build_libdir) $(build_private_libdir) $(build_libexecdir) $(build_includedir) $(build_includedir)/julia $(build_sysconfdir)/julia $(build_datarootdir)/julia $(build_datarootdir)/julia/site $(build_man1dir))
ifneq ($(BUILDROOT),$(JULIAHOME))
BUILDDIRS := $(BUILDROOT) $(addprefix $(BUILDROOT)/,base src ui doc deps test test/embedding test/perf examples)
BUILDDIRS := $(BUILDROOT) $(addprefix $(BUILDROOT)/,base src ui doc deps test test/embedding test/perf)
BUILDDIRMAKE := $(addsuffix /Makefile,$(BUILDDIRS))
DIRS := $(DIRS) $(BUILDDIRS)
$(BUILDDIRMAKE): | $(BUILDDIRS)
Expand Down Expand Up @@ -56,20 +56,6 @@ julia_flisp.boot.inc.phony: julia-deps
$(BUILDROOT)/doc/_build/html/en/index.html: $(shell find $(BUILDROOT)/base $(BUILDROOT)/doc \( -path $(BUILDROOT)/doc/_build -o -path $(BUILDROOT)/doc/deps -o -name *_constants.jl -o -name *_h.jl -o -name version_git.jl \) -prune -o -type f -print)
@$(MAKE) docs

# doc needs to live under $(build_docdir), not under $(build_datarootdir)/julia/
CLEAN_TARGETS += clean-docdir
clean-docdir:
@-rm -fr $(abspath $(build_docdir))

$(build_prefix)/.examples: $(wildcard $(JULIAHOME)/examples/*.jl) \
$(shell find $(JULIAHOME)/examples/clustermanager)
@echo Copying in usr/share/doc/julia/examples
@-rm -fr $(build_docdir)/examples
@mkdir -p $(build_docdir)/examples
@cp -R $(JULIAHOME)/examples/*.jl $(build_docdir)/examples/
@cp -R $(JULIAHOME)/examples/clustermanager $(build_docdir)/examples/
@echo 1 > $@

julia-symlink: julia-ui-$(JULIA_BUILD_MODE)
ifneq ($(OS),WINNT)
ifndef JULIA_VAGRANT_BUILD
Expand All @@ -92,7 +78,7 @@ julia-src-release julia-src-debug : julia-src-% : julia-deps julia_flisp.boot.in
julia-ui-release julia-ui-debug : julia-ui-% : julia-src-%
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/ui julia-$*

julia-base-compiler : julia-base julia-ui-$(JULIA_BUILD_MODE) $(build_prefix)/.examples
julia-base-compiler : julia-base julia-ui-$(JULIA_BUILD_MODE)
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) $(build_private_libdir)/basecompiler.ji JULIA_BUILD_MODE=$(JULIA_BUILD_MODE)

julia-sysimg-release : julia-base-compiler julia-ui-release
Expand Down Expand Up @@ -164,8 +150,9 @@ $(build_sysconfdir)/julia/startup.jl: $(JULIAHOME)/etc/startup.jl | $(build_sysc
$(build_datarootdir)/julia/julia-config.jl : $(JULIAHOME)/contrib/julia-config.jl | $(build_datarootdir)/julia
$(INSTALL_M) $< $(dir $@)

$(build_private_libdir)/%.$(SHLIB_EXT): $(build_private_libdir)/%.o
@$(call PRINT_LINK, $(CXX) $(LDFLAGS) -shared $(fPIC) -L$(build_private_libdir) -L$(build_libdir) -L$(build_shlibdir) -o $@ $< \
$(build_private_libdir)/%.$(SHLIB_EXT): $(build_private_libdir)/%-o.a
@$(call PRINT_LINK, $(CXX) $(LDFLAGS) -shared $(fPIC) -L$(build_private_libdir) -L$(build_libdir) -L$(build_shlibdir) -o $@ \
$(WHOLE_ARCHIVE) $< $(NO_WHOLE_ARCHIVE) \
$(if $(findstring -debug,$(notdir $@)),-ljulia-debug,-ljulia) \
$$([ $(OS) = WINNT ] && echo '' -lssp))
@$(INSTALL_NAME_CMD)$(notdir $@) $@
Expand Down Expand Up @@ -214,15 +201,13 @@ $(build_private_libdir)/basecompiler.ji: $(CORE_SRCS) $(COMPILER_SRCS) | $(build
RELBUILDROOT := $(shell $(JULIAHOME)/contrib/relative_path.sh "$(JULIAHOME)/base" "$(BUILDROOT)/base/")
COMMA:=,
define sysimg_builder
$$(build_private_libdir)/sys$1.o: $$(build_private_libdir)/basecompiler.ji $$(JULIAHOME)/VERSION $$(BASE_SRCS) $$(STDLIB_SRCS)
$$(build_private_libdir)/sys$1-o.a: $$(build_private_libdir)/basecompiler.ji $$(JULIAHOME)/VERSION $$(BASE_SRCS) $$(STDLIB_SRCS)
@$$(call PRINT_JULIA, cd $$(JULIAHOME)/base && \
if $$(call spawn,$3) $2 -C "$$(JULIA_CPU_TARGET)" --output-o $$(call cygpath_w,$$@).tmp $$(JULIA_SYSIMG_BUILD_FLAGS) \
if ! $$(call spawn,$3) $2 -C "$$(JULIA_CPU_TARGET)" --output-o $$(call cygpath_w,$$@) $$(JULIA_SYSIMG_BUILD_FLAGS) \
--startup-file=no --warn-overwrite=yes --sysimage $$(call cygpath_w,$$<) sysimg.jl $$(RELBUILDROOT); then \
mv $$@.tmp $$@; \
else \
echo '*** This error is usually fixed by running `make clean`. If the error persists$$(COMMA) try `make cleanall`. ***' && false; \
fi )
.SECONDARY: $(build_private_libdir)/sys$1.o
.SECONDARY: $(build_private_libdir)/sys$1-o.a
endef
$(eval $(call sysimg_builder,,-O3,$(JULIA_EXECUTABLE_release)))
$(eval $(call sysimg_builder,-debug,-O0,$(JULIA_EXECUTABLE_debug)))
Expand Down Expand Up @@ -354,7 +339,6 @@ endif
# Copy in all .jl sources as well
cp -R -L $(build_datarootdir)/julia $(DESTDIR)$(datarootdir)/
# Copy documentation
cp -R -L $(build_docdir)/* $(DESTDIR)$(docdir)/
cp -R -L $(BUILDROOT)/doc/_build/html $(DESTDIR)$(docdir)/
# Remove perf suite
-rm -rf $(DESTDIR)$(datarootdir)/julia/test/perf/
Expand Down Expand Up @@ -505,7 +489,6 @@ clean: | $(CLEAN_TARGETS)
@-$(MAKE) -C $(BUILDROOT)/src clean
@-$(MAKE) -C $(BUILDROOT)/ui clean
@-$(MAKE) -C $(BUILDROOT)/test clean
@-$(MAKE) -C $(BUILDROOT)/examples clean
-rm -f $(BUILDROOT)/julia
-rm -f $(BUILDROOT)/*.tar.gz
-rm -f $(build_depsbindir)/stringreplace \
Expand All @@ -514,7 +497,6 @@ clean: | $(CLEAN_TARGETS)
-rm -fr $(build_private_libdir)
# Teporarily add this line to the Makefile to remove extras
-rm -fr $(build_datarootdir)/julia/extras
-rm -f $(build_prefix)/.examples

cleanall: clean
@-$(MAKE) -C $(BUILDROOT)/src clean-flisp clean-support
Expand All @@ -532,7 +514,7 @@ distcleanall: cleanall
test testall testall1 test clean distcleanall cleanall clean-* \
run-julia run-julia-debug run-julia-release run \
install binary-dist light-source-dist.tmp light-source-dist \
dist full-source-dist source-dist examples
dist full-source-dist source-dist

test: check-whitespace $(JULIA_BUILD_MODE)
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/test default JULIA_BUILD_MODE=$(JULIA_BUILD_MODE)
Expand Down
9 changes: 9 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ Language changes
* Underscores for `_italics_` and `__bold__` are now supported by the Base Markdown
parser. ([#25564])

* `` (`\dots`) and `` (`\tricolon`) are now parsed as binary operators ([#26262]).

Breaking changes
----------------

Expand All @@ -230,6 +232,10 @@ This section lists changes that do not have deprecation warnings.
* `ntuple(f, n::Integer)` throws `ArgumentError` if `n` is negative.
Previously an empty tuple was returned ([#21697]).

* ``, ``, ``, and `` are now parsed as binary operators, not ordinary
identifiers. ``, ``, and `` now parse with assignment rather than comparison
precedence ([#26262]).

* Juxtaposing string literals (e.g. `"x"y`) is now a syntax error ([#20575]).

* `finalizer(function, object)` now returns `object` rather than `nothing` ([#24679]).
Expand Down Expand Up @@ -588,6 +594,9 @@ Library improvements
collection `A`. There are also two other methods with a different API, and
a mutating variant, `replace!` ([#22324]).

* Adding integers to `CartesianIndex` objects is now deprecated. Instead of
`i::Int + x::CartesianIndex`, use `i*one(x) + x` ([#26284]).

* `CartesianRange` changes ([#24715]):
- Inherits from `AbstractArray`, and linear indexing can be used to provide
linear-to-cartesian conversion ([#24715])
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,6 @@ The Julia source code is organized as follows:
deps/ external dependencies
doc/src/manual source for the user manual
doc/src/stdlib source for standard library function reference
examples/ example Julia programs
src/ source for Julia language core
test/ test suites
test/perf benchmark suites
Expand Down
9 changes: 8 additions & 1 deletion base/Enums.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Create an `Enum{BaseType}` subtype with name `EnumName` and enum member values o
`EnumName` can be used just like other types and enum member values as regular values, such as
# Examples
```jldoctest
```jldoctest fruitenum
julia> @enum Fruit apple=1 orange=2 kiwi=3
julia> f(x::Fruit) = "I'm a Fruit with value: \$(Int(x))"
Expand All @@ -58,6 +58,13 @@ end
`BaseType`, which defaults to [`Int32`](@ref), must be a primitive subtype of `Integer`.
Member values can be converted between the enum type and `BaseType`. `read` and `write`
perform these conversions automatically.
To list all the instances of an enum use `instances`, e.g.
```jldoctest fruitenum
julia> instances(Fruit)
(apple::Fruit = 1, orange::Fruit = 2, kiwi::Fruit = 3)
```
"""
macro enum(T, syms...)
if isempty(syms)
Expand Down
16 changes: 8 additions & 8 deletions base/abstractdict.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ return the elements in the same order.
# Examples
```jldoctest
julia> a = Dict('a'=>2, 'b'=>3)
julia> D = Dict('a'=>2, 'b'=>3)
Dict{Char,Int64} with 2 entries:
'b' => 3
'a' => 2
'b' => 3
julia> collect(keys(a))
julia> collect(keys(D))
2-element Array{Char,1}:
'b'
'a'
'b'
```
"""
keys(a::AbstractDict) = KeySet(a)
Expand All @@ -115,15 +115,15 @@ return the elements in the same order.
# Examples
```jldoctest
julia> a = Dict('a'=>2, 'b'=>3)
julia> D = Dict('a'=>2, 'b'=>3)
Dict{Char,Int64} with 2 entries:
'b' => 3
'a' => 2
'b' => 3
julia> collect(values(a))
julia> collect(values(D))
2-element Array{Int64,1}:
3
2
3
```
"""
values(a::AbstractDict) = ValueIterator(a)
Expand Down
46 changes: 15 additions & 31 deletions base/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1479,8 +1479,7 @@ julia> A = [false, false, true, false]
julia> findnext(A, 1)
3
julia> findnext(A, 4) == nothing
true
julia> findnext(A, 4) # returns nothing, but not printed in the REPL
julia> A = [false false; true false]
2×2 Array{Bool,2}:
Expand Down Expand Up @@ -1531,8 +1530,7 @@ julia> A = [false, false, true, false]
julia> findfirst(A)
3
julia> findfirst(falses(3)) == nothing
true
julia> findfirst(falses(3)) # returns nothing, but not printed in the REPL
julia> A = [false false; true false]
2×2 Array{Bool,2}:
Expand Down Expand Up @@ -1571,23 +1569,14 @@ and [`pairs(A)`](@ref).
# Examples
```jldoctest
A = [1, 4, 2, 2]
4-element Array{Int64,1}:
1
4
2
2
julia> A = [1, 4, 2, 2];
julia> findnext(isodd, A, 1)
1
julia> findnext(isodd, A, 2) == nothing
true
julia> findnext(isodd, A, 2) # returns nothing, but not printed in the REPL
julia> A = [1 4; 2 2]
2×2 Array{Int64,2}:
1 4
2 2
julia> A = [1 4; 2 2];
julia> findnext(isodd, A, CartesianIndex(1, 1))
CartesianIndex(1, 1)
Expand Down Expand Up @@ -1626,8 +1615,7 @@ julia> A = [1, 4, 2, 2]
julia> findfirst(iseven, A)
2
julia> findfirst(x -> x>10, A) == nothing
true
julia> findfirst(x -> x>10, A) # returns nothing, but not printed in the REPL
julia> findfirst(equalto(4), A)
2
Expand Down Expand Up @@ -1673,8 +1661,7 @@ julia> A = [false, false, true, true]
julia> findprev(A, 3)
3
julia> findprev(A, 1) == nothing
true
julia> findprev(A, 1) # returns nothing, but not printed in the REPL
julia> A = [false false; true true]
2×2 Array{Bool,2}:
Expand Down Expand Up @@ -1723,8 +1710,7 @@ julia> findlast(A)
julia> A = falses(2,2);
julia> findlast(A) == nothing
true
julia> findlast(A) # returns nothing, but not printed in the REPL
julia> A = [true false; true false]
2×2 Array{Bool,2}:
Expand Down Expand Up @@ -1770,8 +1756,7 @@ julia> A = [4, 6, 1, 2]
1
2
julia> findprev(isodd, A, 1) == nothing
true
julia> findprev(isodd, A, 1) # returns nothing, but not printed in the REPL
julia> findprev(isodd, A, 3)
3
Expand Down Expand Up @@ -1815,8 +1800,7 @@ julia> A = [1, 2, 3, 4]
julia> findlast(isodd, A)
3
julia> findlast(x -> x > 5, A) == nothing
true
julia> findlast(x -> x > 5, A) # returns nothing, but not printed in the REPL
julia> A = [1 2; 3 4]
2×2 Array{Int64,2}:
Expand Down Expand Up @@ -1921,9 +1905,9 @@ julia> A = [true false; false true]
false true
julia> findall(A)
2-element Array{Int64,1}:
1
4
2-element Array{CartesianIndex{2},1}:
CartesianIndex(1, 1)
CartesianIndex(2, 2)
julia> findall(falses(3))
0-element Array{Int64,1}
Expand Down Expand Up @@ -2093,9 +2077,9 @@ array contains `nothing` wherever `a` is not a member of `b`.
# Examples
```jldoctest
julia> a = ['a', 'b', 'c', 'b', 'd', 'a']
julia> a = ['a', 'b', 'c', 'b', 'd', 'a'];
julia> b = ['a', 'b', 'c']
julia> b = ['a', 'b', 'c'];
julia> indexin(a, b)
6-element Array{Union{Nothing, Int64},1}:
Expand Down
4 changes: 2 additions & 2 deletions base/broadcast.jl
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ would be the broadcast `inds`). The shape of the output is equal to the shape of
element of `indsb`.
# Examples
```jldoctest
```jldoctest bc_getindex
julia> A = [11 12; 21 22]
2×2 Array{Int64,2}:
11 12
Expand Down Expand Up @@ -729,7 +729,7 @@ julia> broadcast_getindex(A, 1:2, 2:-1:1)
Because the indices are all vectors, these calls are like `[A[i[k], j[k]] for k = 1:2]`
where `i` and `j` are the two index vectors.
```jldoctest
```jldoctest bc_getindex
julia> broadcast_getindex(A, 1:2, (1:2)')
2×2 Array{Int64,2}:
11 12
Expand Down
2 changes: 1 addition & 1 deletion base/char.jl
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ function show(io::IO, ::MIME"text/plain", c::Char)
else
u = UInt32(c)
end
h = hex(u, u 0xffff ? 4 : 6)
h = string(u, base = 16, pad = u 0xffff ? 4 : 6)
print(io, (isascii(c) ? "ASCII/" : ""), "Unicode U+", h)
else
print(io, ": Malformed UTF-8")
Expand Down
Loading

0 comments on commit 95a78df

Please sign in to comment.