Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: JuliaLang/julia
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: e2cefe4e1f8d36d841d1c9f0406694e7836ce881
Choose a base ref
..
head repository: JuliaLang/julia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3b97b615b46c27487ab53d25b7d15c84980a33bf
Choose a head ref
Showing with 4,499 additions and 2,442 deletions.
  1. +1 −1 CONTRIBUTING.md
  2. +45 −2 Make.inc
  3. +3 −3 Makefile
  4. +75 −0 NEWS.md
  5. +9 −9 base/Enums.jl
  6. +6 −4 base/REPLCompletions.jl
  7. +2 −2 base/abstractarray.jl
  8. +1 −1 base/array.jl
  9. +1 −1 base/associative.jl
  10. +10 −10 base/atomics.jl
  11. +4 −4 base/boot.jl
  12. +17 −1 base/c.jl
  13. +1 −1 base/char.jl
  14. +12 −10 base/client.jl
  15. +4 −2 base/coreimg.jl
  16. +5 −5 base/datafmt.jl
  17. +1 −1 base/dates/Dates.jl
  18. +58 −20 base/dates/io.jl
  19. +4 −4 base/dates/periods.jl
  20. +75 −4 base/deprecated.jl
  21. +5 −5 base/dict.jl
  22. +7 −7 base/distributed/managers.jl
  23. +1 −1 base/distributed/remotecall.jl
  24. +4 −4 base/distributed/workerpool.jl
  25. +48 −45 base/docs/Docs.jl
  26. +1 −1 base/docs/bindings.jl
  27. +7 −7 base/docs/core.jl
  28. +2 −3 base/docs/helpdb/Base.jl
  29. +5 −3 base/docs/utils.jl
  30. +1 −1 base/env.jl
  31. +3 −12 base/essentials.jl
  32. +2 −1 base/exports.jl
  33. +18 −8 base/expr.jl
  34. +3 −3 base/fastmath.jl
  35. +4 −4 base/fft/FFTW.jl
  36. +1 −1 base/gmp.jl
  37. +1 −1 base/grisu/float.jl
  38. +496 −150 base/inference.jl
  39. +1 −1 base/int.jl
  40. +72 −49 base/interactiveutil.jl
  41. +36 −4 base/io.jl
  42. +1 −14 base/iostream.jl
  43. +2 −2 base/iterators.jl
  44. +64 −0 base/libgit2/config.jl
  45. +0 −43 base/libgit2/libgit2.jl
  46. +1 −1 base/libgit2/reference.jl
  47. +133 −3 base/libgit2/remote.jl
  48. +22 −4 base/libgit2/types.jl
  49. +1 −1 base/linalg/bitarray.jl
  50. +2 −2 base/linalg/bunchkaufman.jl
  51. +29 −50 base/linalg/cholesky.jl
  52. +12 −15 base/linalg/dense.jl
  53. +1 −1 base/linalg/factorization.jl
  54. +2 −2 base/linalg/generic.jl
  55. +1 −1 base/linalg/givens.jl
  56. +1 −1 base/linalg/lq.jl
  57. +1 −1 base/linalg/qr.jl
  58. +1 −1 base/linalg/rowvector.jl
  59. +1 −1 base/linalg/schur.jl
  60. +3 −3 base/linalg/special.jl
  61. +1 −1 base/linalg/svd.jl
  62. +22 −17 base/linalg/symmetric.jl
  63. +16 −1 base/linalg/uniformscaling.jl
  64. +43 −23 base/loading.jl
  65. +6 −6 base/markdown/Markdown.jl
  66. +1 −1 base/markdown/render/html.jl
  67. +1 −1 base/markdown/render/latex.jl
  68. +1 −1 base/markdown/render/rst.jl
  69. +1 −1 base/markdown/render/terminal/render.jl
  70. +1 −1 base/mpfr.jl
  71. +22 −31 base/multidimensional.jl
  72. +1 −1 base/multinverses.jl
  73. +1 −1 base/nullable.jl
  74. +9 −9 base/operators.jl
  75. +4 −3 base/osutils.jl
  76. +1 −1 base/pair.jl
  77. +1 −1 base/pkg/cache.jl
  78. +2 −2 base/pkg/dir.jl
  79. +15 −9 base/pkg/entry.jl
  80. +1 −1 base/pkg/resolve/versionweight.jl
  81. +1 −1 base/pkg/write.jl
  82. +3 −3 base/precompile.jl
  83. +1 −1 base/process.jl
  84. +3 −3 base/promotion.jl
  85. +82 −63 base/random.jl
  86. +28 −18 base/range.jl
  87. +1 −1 base/reducedim.jl
  88. +19 −12 base/reflection.jl
  89. +1 −1 base/reshapedarray.jl
  90. +8 −4 base/serialize.jl
  91. +1 −1 base/set.jl
  92. +31 −11 base/show.jl
  93. +1 −1 base/socket.jl
  94. +91 −9 base/sparse/cholmod.jl
  95. +2 −2 base/sparse/linalg.jl
  96. +23 −20 base/sparse/sparsematrix.jl
  97. +12 −1 base/sparse/sparsevector.jl
  98. +11 −11 base/sparse/umfpack.jl
  99. +2 −2 base/special/trig.jl
  100. +3 −2 base/stacktraces.jl
  101. +1 −1 base/statistics.jl
  102. +7 −7 base/subarray.jl
  103. +32 −16 base/sysimg.jl
  104. +38 −2 base/test.jl
  105. +2 −2 base/twiceprecision.jl
  106. +18 −9 base/util.jl
  107. +5 −5 base/weakkeydict.jl
  108. +6 −0 contrib/prepare_release.sh
  109. +2 −0 deps/Makefile
  110. +1 −5 deps/libgit2.mk
  111. +0 −8 deps/libssh2.mk
  112. +68 −20 deps/llvm.mk
  113. +0 −8 deps/mbedtls.mk
  114. +11 −0 deps/tools/common.mk
  115. +11 −9 doc/src/devdocs/ast.md
  116. +2 −2 doc/src/devdocs/backtraces.md
  117. +1 −52 doc/src/devdocs/functions.md
  118. +8 −10 doc/src/manual/calling-c-and-fortran-code.md
  119. +1 −0 doc/src/manual/embedding.md
  120. +4 −4 doc/src/manual/functions.md
  121. +2 −2 doc/src/manual/interacting-with-julia.md
  122. +10 −3 doc/src/manual/metaprogramming.md
  123. +1 −1 doc/src/manual/methods.md
  124. +2 −2 doc/src/manual/modules.md
  125. +2 −2 doc/src/manual/parallel-computing.md
  126. +1 −1 doc/src/manual/performance-tips.md
  127. +2 −1 doc/src/stdlib/base.md
  128. +1 −1 doc/src/stdlib/sort.md
  129. +2 −0 examples/embedding/embedding.c
  130. +59 −57 src/ast.c
  131. +8 −4 src/builtins.c
  132. +4 −4 src/ccall.cpp
  133. +3 −3 src/cgutils.cpp
  134. +162 −69 src/codegen.cpp
  135. +19 −21 src/datatype.c
  136. +11 −7 src/debuginfo.cpp
  137. +18 −18 src/dump.c
  138. +41 −39 src/gf.c
  139. +5 −5 src/init.c
  140. +55 −47 src/interpreter.c
  141. +1 −1 src/jitlayers.cpp
  142. +1 −1 src/jitlayers.h
  143. +10 −1 src/jl_uv.c
  144. +1 −1 src/jlapi.c
  145. +17 −13 src/jlfrontend.scm
  146. +161 −158 src/jltypes.c
  147. +280 −266 src/julia-parser.scm
  148. +20 −0 src/julia-syntax.scm
  149. +45 −12 src/julia.h
  150. +21 −21 src/julia_internal.h
  151. +28 −6 src/llvm-simdloop.cpp
  152. +40 −37 src/method.c
  153. +3 −6 src/module.c
  154. +33 −17 src/rtutils.c
  155. +11 −5 src/signals-unix.c
  156. +16 −2 src/stackwalk.c
  157. +170 −193 src/subtype.c
  158. +1 −0 src/support/ios.c
  159. +1 −0 src/task.c
  160. +65 −61 src/toplevel.c
  161. +10 −0 test/boundscheck_exec.jl
  162. +6 −6 test/broadcast.jl
  163. +1 −1 test/choosetests.jl
  164. +2 −2 test/cmdlineargs.jl
  165. +6 −0 test/compile.jl
  166. +11 −0 test/complex.jl
  167. +86 −116 test/core.jl
  168. +52 −0 test/dates/io.jl
  169. +5 −10 test/distributed_exec.jl
  170. +7 −6 test/docs.jl
  171. +6 −6 test/fastmath.jl
  172. +96 −1 test/inference.jl
  173. +2 −2 test/inline.jl
  174. +26 −0 test/iobuffer.jl
  175. +7 −0 test/iostream.jl
  176. +108 −3 test/libgit2.jl
  177. +38 −28 test/linalg/cholesky.jl
  178. +6 −1 test/linalg/dense.jl
  179. +1 −0 test/linalg/diagonal.jl
  180. +2 −1 test/linalg/eigen.jl
  181. +8 −6 test/linalg/generic.jl
  182. +3 −0 test/linalg/special.jl
  183. +53 −41 test/linalg/symmetric.jl
  184. +7 −0 test/linalg/uniformscaling.jl
  185. +16 −0 test/llvmcall.jl
  186. +20 −2 test/llvmpasses/simdloop.ll
  187. +2 −2 test/loading.jl
  188. +9 −2 test/misc.jl
  189. +46 −38 test/parse.jl
  190. +51 −8 test/pkg.jl
  191. +28 −12 test/random.jl
  192. +18 −0 test/ranges.jl
  193. +30 −27 test/reflection.jl
  194. +1 −1 test/repl.jl
  195. +4 −4 test/replutil.jl
  196. +37 −0 test/show.jl
  197. +37 −0 test/sparse/cholmod.jl
  198. +6 −1 test/sparse/sparsevector.jl
  199. +0 −8 test/spawn.jl
  200. +172 −0 test/specificity.jl
  201. +2 −1 test/stacktraces.jl
  202. +1 −1 test/staged.jl
  203. +1 −1 test/strings/basic.jl
  204. +74 −0 test/strings/io.jl
  205. +5 −0 test/subtype.jl
  206. +2 −2 test/testenv.jl
  207. +6 −6 test/threads.jl
  208. +6 −0 test/tuple.jl
  209. +19 −11 test/workspace.jl
  210. +2 −16 ui/repl.c
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@ A useful bug report filed as a GitHub issue provides information about how to re
3. When filing a bug report, provide where possible:
- The full error message, including the backtrace.
- A minimal working example, i.e. the smallest chunk of code that triggers the error. Ideally, this should be code that can be pasted into a REPL or run from a source file. If the code is larger than (say) 50 lines, consider putting it in a [gist](https://gist.github.com).
- The version of Julia as provided by the `versioninfo()` command. Occasionally, the longer output produced by `versioninfo(true)` may be useful also, especially if the issue is related to a specific package.
- The version of Julia as provided by the `versioninfo()` command. Occasionally, the longer output produced by `versioninfo(verbose = true)` may be useful also, especially if the issue is related to a specific package.

4. When pasting code blocks or output, put triple backquotes (\`\`\`) around the text so GitHub will format it nicely. Code statements should be surrounded by single backquotes (\`). Be aware that the `@` sign tags users on GitHub, so references to macros should always be in single backquotes. See [GitHub's guide on Markdown](https://guides.github.com/features/mastering-markdown) for more formatting tricks.

47 changes: 45 additions & 2 deletions Make.inc
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@ OPENBLAS_USE_THREAD:=1
# Use libraries available on the system instead of building them
USE_SYSTEM_LLVM:=0
USE_SYSTEM_LIBUNWIND:=0
DISABLE_LIBUNWIND:=0
USE_SYSTEM_PCRE:=0
USE_SYSTEM_LIBM:=0
USE_SYSTEM_OPENLIBM:=0
@@ -524,6 +525,36 @@ ifeq (exists, $(shell [ -e $(BUILDROOT)/Make.user ] && echo exists ))
include $(BUILDROOT)/Make.user
endif

# A bit of a kludge to work around libraries linking to FreeBSD's outdated system libgcc_s
# Instead, let's link to the libgcc_s corresponding to the installation of gfortran
ifeq ($(OS),FreeBSD)
ifneq (,$(findstring gfortran,$(FC)))

# First let's figure out what version of GCC we're dealing with
_GCCMAJOR := $(shell $(FC) -dumpversion | cut -d'.' -f1)
_GCCMINOR := $(shell $(FC) -dumpversion | cut -d'.' -f2)

# The ports system uses major and minor for GCC < 5 (e.g. gcc49 for GCC 4.9), otherwise major only
ifeq ($(_GCCMAJOR),4)
_GCCVER := $(_GCCMAJOR)$(_GCCMINOR)
else
_GCCVER := $(_GCCMAJOR)
endif

# Allow the user to specify this in Make.user
GCCPATH ?= $(LOCALBASE)/lib/gcc$(_GCCVER)

LDFLAGS += -L$(build_libdir) -L$(GCCPATH) -Wl,-rpath,$(build_libdir) -Wl,-rpath,$(GCCPATH)

# This ensures we get the right RPATH even if we're missing FFLAGS somewhere
FC += -Wl,-rpath=$(GCCPATH)

# Build our own libc++ and libc++abi because otherwise /usr/lib/libc++.so and /lib/libcxxrt.so will
# be linked in when building LLVM, and those link to /lib/libgcc_s.so
BUILD_CUSTOM_LIBCXX ?= 1
endif # gfortran
endif # FreeBSD

ifneq ($(CC_BASE)$(CXX_BASE),$(shell echo $(CC) | cut -d' ' -f1)$(shell echo $(CXX) | cut -d' ' -f1))
$(error Forgot override directive on CC or CXX in Make.user? Cowardly refusing to build)
endif
@@ -737,6 +768,8 @@ endif

ifeq ($(OS),WINNT)
LIBUNWIND:=
else ifneq ($(DISABLE_LIBUNWIND), 0)
LIBUNWIND:=
else
ifeq ($(USE_SYSTEM_LIBUNWIND), 1)
ifneq ($(OS),Darwin)
@@ -985,6 +1018,10 @@ ifeq ($(USE_OPROFILE_JITEVENTS), 1)
JCPPFLAGS += -DJL_USE_OPROFILE_JITEVENTS
endif

ifeq ($(DISABLE_LIBUNWIND), 1)
JCPPFLAGS += -DJL_DISABLE_LIBUNWIND
endif

# Intel libraries

ifeq ($(USE_INTEL_LIBM), 1)
@@ -1069,8 +1106,14 @@ endif
# Custom libcxx
ifeq ($(BUILD_CUSTOM_LIBCXX),1)
LDFLAGS += -L$(build_libdir)
CXXLDFLAGS += -L$(build_libdir) -lc++abi -stdlib=libc++ -lc++
CPPFLAGS += -I$(build_includedir)/c++/v1
CXXLDFLAGS += -L$(build_libdir) -lc++abi -lc++
ifeq ($(USECLANG),1)
CXXLDFLAGS += -stdlib=libc++
else
ifeq ($(USEGCC),1)
$(error BUILD_CUSTOM_LIBCXX is currently only supported with Clang. Try setting BUILD_CUSTOM_LIBCXX=0)
endif
endif # Clang
CUSTOM_LD_LIBRARY_PATH := LD_LIBRARY_PATH="$(build_libdir)"
ifeq ($(USEICC),1)
CXXFLAGS += -cxxlib-nostd -static-intel
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -461,7 +461,7 @@ endif

ifeq ($(OS), WINNT)
[ ! -d $(JULIAHOME)/dist-extras ] || ( cd $(JULIAHOME)/dist-extras && \
cp 7z.exe 7z.dll libexpat-1.dll zlib1.dll libgfortran-3.dll libquadmath-0.dll libstdc++-6.dll libgcc_s_s*-1.dll libssp-0.dll libwinpthread-1.dll $(BUILDROOT)/julia-$(JULIA_COMMIT)/bin )
cp 7z.exe 7z.dll libexpat-1.dll zlib1.dll $(BUILDROOT)/julia-$(JULIA_COMMIT)/bin )
ifeq ($(USE_GPL_LIBS), 1)
[ ! -d $(JULIAHOME)/dist-extras ] || ( cd $(JULIAHOME)/dist-extras && \
cp busybox.exe $(BUILDROOT)/julia-$(JULIA_COMMIT)/bin )
@@ -592,7 +592,7 @@ ifneq (,$(filter $(ARCH), i386 i486 i586 i686))
$(JLDOWNLOAD) http://downloads.sourceforge.net/sevenzip/7z920.exe && \
7z x -y 7z920.exe 7z.exe 7z.dll && \
../contrib/windows/winrpm.sh http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Leap_42.2 \
"mingw32-libgfortran3 mingw32-libquadmath0 mingw32-libstdc++6 mingw32-libgcc_s_sjlj1 mingw32-libssp0 mingw32-libwinpthread1 mingw32-libexpat1 mingw32-zlib1" && \
"mingw32-libexpat1 mingw32-zlib1" && \
cp usr/i686-w64-mingw32/sys-root/mingw/bin/*.dll .
else ifeq ($(ARCH),x86_64)
cd $(JULIAHOME)/dist-extras && \
@@ -601,7 +601,7 @@ else ifeq ($(ARCH),x86_64)
mv _7z.dll 7z.dll && \
mv _7z.exe 7z.exe && \
../contrib/windows/winrpm.sh http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_Leap_42.2 \
"mingw64-libgfortran3 mingw64-libquadmath0 mingw64-libstdc++6 mingw64-libgcc_s_seh1 mingw64-libssp0 mingw64-libwinpthread1 mingw64-libexpat1 mingw64-zlib1" && \
"mingw64-libexpat1 mingw64-zlib1" && \
cp usr/x86_64-w64-mingw32/sys-root/mingw/bin/*.dll .
else
$(error no win-extras target for ARCH=$(ARCH))
75 changes: 75 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -4,6 +4,9 @@ Julia v0.7.0 Release Notes
New language features
---------------------

* Local variables can be tested for being defined
using the new `@isdefined variable` macro ([#TBD]).

Language changes
----------------

@@ -56,6 +59,15 @@ Library improvements
* `resize!` and `sizehint!` methods no longer over-reserve memory when the
requested array size is more than double of its current size ([#22038]).

* The output of `versioninfo()` is now controlled with keyword arguments ([#21974]).

* The function `LibGit2.set_remote_url` now always sets both the fetch and push URLs for a
git repo. Additionally, the argument order was changed to be consistent with the git
command line tool ([#22062]).

* `logspace` now accepts a `base` keyword argument to specify the base of the logarithmic
range. The base defaults to 10 ([#22310]).

Compiler/Runtime improvements
-----------------------------

@@ -68,6 +80,18 @@ Deprecated or removed

* The method `srand(rng, filename, n=4)` has been deprecated ([#21359]).

* The `cholfact`/`cholfact!` methods that accepted an `uplo` symbol have been deprecated
in favor of using `Hermitian` (or `Symmetric`) views ([#22187], [#22188]).

* `isposdef(A::AbstractMatrix, UL::Symbol)` and `isposdef!(A::AbstractMatrix, UL::Symbol)`
have been deprecated in favor of `isposdef(Hermitian(A, UL))` and `isposdef!(Hermitian(A, UL))`
respectively ([#22245]).

* The function `current_module` is deprecated and replaced with `@__MODULE__` ([#22064]).
This caused the deprecation of some reflection methods (such as `macroexpand` and `isconst`),
which now require a module argument.
And it caused the bugfix of other default arguments to use the Main module (including `whos`, `which`).


Julia v0.6.0 Release Notes
==========================
@@ -403,6 +427,22 @@ Library improvements
that dimension's length will be computed such that its product with all the other dimensions is equal
to the length of the original array ([#19919]).
* The new `to_indices` function provides a uniform interface for index conversions,
taking an array and a tuple of indices as arguments and returning a tuple of
integers and/or arrays of supported scalar indices. It will throw an `ArgumentError`
for any unsupported indices, and the returned arrays should be iterated over (and
not indexed into) to support more efficient logical indexing ([#19730]).
+ Using colons (`:`) to represent a collection of indices is deprecated. They now must be
explicitly converted to a specialized array of integers with the `to_indices` function.
   As a result, the type of `SubArray`s that represent views over colon indices has changed.
+ Logical indexing is now more efficient. Logical arrays are converted by `to_indices` to
a lazy, iterable collection of indices that doesn't support indexing. A deprecation
provides indexing support with O(n) lookup.
+ The performance of indexing with `CartesianIndex`es is also improved in many situations.
* A new `titlecase` function was added, to capitalize the first character of each word within a string ([#19469]).
* `any` and `all` now always short-circuit, and `mapreduce` never short-circuits ([#19543]).
@@ -646,6 +686,23 @@ Deprecated or removed
[StatsBase.jl package](https://github.com/JuliaStats/StatsBase.jl)'s
`midpoints` function ([#20058]).
* Passing a type argument to `LibGit2.cat` has been deprecated in favor of a simpler,
two-argument method for `LibGit2.cat` ([#20435]).
* The `LibGit2.owner` function for finding the repository which owns a given Git object
has been deprecated in favor of `LibGit2.repository` ([#20135]).
* The `LibGit2.GitAnyObject` type has been renamed to `LibGit2.GitUnknownObject` to
clarify its intent ([#19935]).
* The `LibGit2.GitOid` type has been renamed to `LibGit2.GitHash` for clarity ([#19878]).
* Finalizing `LibGit2` objects with `finalize` has been deprecated in favor of using `close`
([#19660]).
* Parsing string dates from a `Dates.DateFormat` object has been deprecated as part of a
larger effort toward faster, more extensible date parsing ([#20952]).
Command-line option changes
---------------------------
@@ -735,6 +792,7 @@ Command-line option changes
[#19598]: https://github.com/JuliaLang/julia/issues/19598
[#19635]: https://github.com/JuliaLang/julia/issues/19635
[#19636]: https://github.com/JuliaLang/julia/issues/19636
[#19660]: https://github.com/JuliaLang/julia/issues/19660
[#19669]: https://github.com/JuliaLang/julia/issues/19669
[#19670]: https://github.com/JuliaLang/julia/issues/19670
[#19677]: https://github.com/JuliaLang/julia/issues/19677
@@ -747,6 +805,7 @@ Command-line option changes
[#19721]: https://github.com/JuliaLang/julia/issues/19721
[#19722]: https://github.com/JuliaLang/julia/issues/19722
[#19724]: https://github.com/JuliaLang/julia/issues/19724
[#19730]: https://github.com/JuliaLang/julia/issues/19730
[#19737]: https://github.com/JuliaLang/julia/issues/19737
[#19741]: https://github.com/JuliaLang/julia/issues/19741
[#19766]: https://github.com/JuliaLang/julia/issues/19766
@@ -761,6 +820,7 @@ Command-line option changes
[#19811]: https://github.com/JuliaLang/julia/issues/19811
[#19814]: https://github.com/JuliaLang/julia/issues/19814
[#19841]: https://github.com/JuliaLang/julia/issues/19841
[#19878]: https://github.com/JuliaLang/julia/issues/19878
[#19900]: https://github.com/JuliaLang/julia/issues/19900
[#19901]: https://github.com/JuliaLang/julia/issues/19901
[#19903]: https://github.com/JuliaLang/julia/issues/19903
@@ -770,6 +830,7 @@ Command-line option changes
[#19926]: https://github.com/JuliaLang/julia/issues/19926
[#19931]: https://github.com/JuliaLang/julia/issues/19931
[#19934]: https://github.com/JuliaLang/julia/issues/19934
[#19935]: https://github.com/JuliaLang/julia/issues/19935
[#19937]: https://github.com/JuliaLang/julia/issues/19937
[#19944]: https://github.com/JuliaLang/julia/issues/19944
[#19949]: https://github.com/JuliaLang/julia/issues/19949
@@ -779,6 +840,7 @@ Command-line option changes
[#20047]: https://github.com/JuliaLang/julia/issues/20047
[#20058]: https://github.com/JuliaLang/julia/issues/20058
[#20079]: https://github.com/JuliaLang/julia/issues/20079
[#20135]: https://github.com/JuliaLang/julia/issues/20135
[#20164]: https://github.com/JuliaLang/julia/issues/20164
[#20213]: https://github.com/JuliaLang/julia/issues/20213
[#20228]: https://github.com/JuliaLang/julia/issues/20228
@@ -798,14 +860,27 @@ Command-line option changes
[#20414]: https://github.com/JuliaLang/julia/issues/20414
[#20418]: https://github.com/JuliaLang/julia/issues/20418
[#20427]: https://github.com/JuliaLang/julia/issues/20427
[#20435]: https://github.com/JuliaLang/julia/issues/20435
[#20500]: https://github.com/JuliaLang/julia/issues/20500
[#20530]: https://github.com/JuliaLang/julia/issues/20530
[#20543]: https://github.com/JuliaLang/julia/issues/20543
[#20575]: https://github.com/JuliaLang/julia/issues/20575
[#20609]: https://github.com/JuliaLang/julia/issues/20609
[#20889]: https://github.com/JuliaLang/julia/issues/20889
[#20952]: https://github.com/JuliaLang/julia/issues/20952
[#21183]: https://github.com/JuliaLang/julia/issues/21183
[#21359]: https://github.com/JuliaLang/julia/issues/21359
[#21692]: https://github.com/JuliaLang/julia/issues/21692
[#21697]: https://github.com/JuliaLang/julia/issues/21697
[#21746]: https://github.com/JuliaLang/julia/issues/21746
[#21759]: https://github.com/JuliaLang/julia/issues/21759
[#21818]: https://github.com/JuliaLang/julia/issues/21818
[#21825]: https://github.com/JuliaLang/julia/issues/21825
[#21973]: https://github.com/JuliaLang/julia/issues/21973
[#21974]: https://github.com/JuliaLang/julia/issues/21974
[#22007]: https://github.com/JuliaLang/julia/issues/22007
[#22038]: https://github.com/JuliaLang/julia/issues/22038
[#22062]: https://github.com/JuliaLang/julia/issues/22062
[#22064]: https://github.com/JuliaLang/julia/issues/22064
[#22187]: https://github.com/JuliaLang/julia/issues/22187
[#22188]: https://github.com/JuliaLang/julia/issues/22188
18 changes: 9 additions & 9 deletions base/Enums.jl
Original file line number Diff line number Diff line change
@@ -49,34 +49,34 @@ julia> f(apple)
Member values can be converted between the enum type and `BaseType`. `read` and `write`
perform these conversions automatically.
"""
macro enum(T,syms...)
macro enum(T, syms...)
if isempty(syms)
throw(ArgumentError("no arguments given for Enum $T"))
end
basetype = Int32
typename = T
if isa(T,Expr) && T.head == :(::) && length(T.args) == 2 && isa(T.args[1], Symbol)
if isa(T, Expr) && T.head == :(::) && length(T.args) == 2 && isa(T.args[1], Symbol)
typename = T.args[1]
basetype = eval(current_module(),T.args[2])
basetype = eval(__module__, T.args[2])
if !isa(basetype, DataType) || !(basetype <: Integer) || !isbits(basetype)
throw(ArgumentError("invalid base type for Enum $typename, $T=::$basetype; base type must be an integer primitive type"))
end
elseif !isa(T,Symbol)
elseif !isa(T, Symbol)
throw(ArgumentError("invalid type expression for enum $T"))
end
vals = Vector{Tuple{Symbol,Integer}}(0)
lo = hi = 0
i = zero(basetype)
hasexpr = false
for s in syms
if isa(s,Symbol)
if isa(s, Symbol)
if i == typemin(basetype) && !isempty(vals)
throw(ArgumentError("overflow in value \"$s\" of Enum $typename"))
end
elseif isa(s,Expr) &&
elseif isa(s, Expr) &&
(s.head == :(=) || s.head == :kw) &&
length(s.args) == 2 && isa(s.args[1],Symbol)
i = eval(current_module(),s.args[2]) # allow exprs, e.g. uint128"1"
length(s.args) == 2 && isa(s.args[1], Symbol)
i = eval(__module__, s.args[2]) # allow exprs, e.g. uint128"1"
if !isa(i, Integer)
throw(ArgumentError("invalid value for Enum $typename, $s=$i; values must be integers"))
end
@@ -144,7 +144,7 @@ macro enum(T,syms...)
end
end
end
if isa(typename,Symbol)
if isa(typename, Symbol)
for (sym,i) in vals
push!(blk.args, :(const $(esc(sym)) = $(esc(typename))($i)))
end
10 changes: 6 additions & 4 deletions base/REPLCompletions.jl
Original file line number Diff line number Diff line change
@@ -292,9 +292,10 @@ function get_type_call(expr::Expr)
return_type === nothing && return (Any, false)
return (return_type, true)
end
# Returns the return type. example: get_type(:(Base.strip("",' ')),Main) returns (String,true)
function get_type(sym::Expr, fn)
sym=expand(sym)

# Returns the return type. example: get_type(:(Base.strip("", ' ')), Main) returns (String, true)
function get_type(sym::Expr, fn::Module)
sym = expand(fn, sym)
val, found = get_value(sym, fn)
found && return Base.typesof(val).parameters[1], found
if sym.head === :call
@@ -310,10 +311,11 @@ function get_type(sym::Expr, fn)
end
return (Any, false)
end
function get_type(sym, fn)
function get_type(sym, fn::Module)
val, found = get_value(sym, fn)
return found ? Base.typesof(val).parameters[1] : Any, found
end

# Method completion on function call expression that look like :(max(1))
function complete_methods(ex_org::Expr)
args_ex = Any[]
4 changes: 2 additions & 2 deletions base/abstractarray.jl
Original file line number Diff line number Diff line change
@@ -870,7 +870,7 @@ end
# to transform the indices such that we can call the only getindex method that
# we require the type A{T,N} <: AbstractArray{T,N} to define; either:
# getindex(::A, ::Int) # if IndexStyle(A) == IndexLinear() OR
# getindex{T,N}(::A{T,N}, ::Vararg{Int, N}) # if IndexCartesian()
# getindex(::A{T,N}, ::Vararg{Int, N}) where {T,N} # if IndexCartesian()
# If the subtype hasn't defined the required method, it falls back to the
# _getindex function again where an error is thrown to prevent stack overflows.

@@ -1192,7 +1192,7 @@ end
_cs(d, a, b) = (a == b ? a : throw(DimensionMismatch(
"mismatch in dimension $d (expected $a got $b)")))

dims2cat{n}(::Type{Val{n}}) = ntuple(i -> (i == n), Val{n})
dims2cat(::Type{Val{n}}) where {n} = ntuple(i -> (i == n), Val{n})
dims2cat(dims) = ntuple(i -> (i in dims), maximum(dims))

cat(dims, X...) = cat_t(dims, promote_eltypeof(X...), X...)
2 changes: 1 addition & 1 deletion base/array.jl
Original file line number Diff line number Diff line change
@@ -96,7 +96,7 @@ sizeof(a::Array) = elsize(a) * length(a)
function isassigned(a::Array, i::Int...)
@_inline_meta
ii = (sub2ind(size(a), i...) % UInt) - 1
ii < length(a) % UInt || return false
@boundscheck ii < length(a) % UInt || return false
ccall(:jl_array_isassigned, Cint, (Any, UInt), a, ii) == 1
end

2 changes: 1 addition & 1 deletion base/associative.jl
Original file line number Diff line number Diff line change
@@ -218,7 +218,7 @@ String
```
"""
valtype(::Type{Associative{K,V}}) where {K,V} = V
valtype{A<:Associative}(::Type{A}) = valtype(supertype(A))
valtype(::Type{A}) where {A<:Associative} = valtype(supertype(A))
valtype(a::Associative) = valtype(typeof(a))

"""
Loading