@@ -123,7 +123,7 @@ export
123
123
SimpleVector, AbstractArray, DenseArray,
124
124
# special objects
125
125
Function, CodeInfo, Method, MethodTable, TypeMapEntry, TypeMapLevel,
126
- Module, Symbol, Task, Array, WeakRef, VecElement,
126
+ Module, Symbol, Task, Array, junk, WeakRef, VecElement,
127
127
# numeric types
128
128
Number, Real, Integer, Bool, Ref, Ptr,
129
129
AbstractFloat, Float16, Float32, Float64,
@@ -350,25 +350,44 @@ unsafe_convert(::Type{T}, x::T) where {T} = x
350
350
const NTuple{N,T} = Tuple{Vararg{T,N}}
351
351
352
352
353
- # primitive array constructors
354
- Array {T,N} (d:: NTuple{N,Int} ) where {T,N} =
355
- ccall (:jl_new_array , Array{T,N}, (Any, Any), Array{T,N}, d)
356
- Array {T,1} (d:: NTuple{1,Int} ) where {T} = Array {T,1} (getfield (d,1 ))
357
- Array {T,2} (d:: NTuple{2,Int} ) where {T} = Array {T,2} (getfield (d,1 ), getfield (d,2 ))
358
- Array {T,3} (d:: NTuple{3,Int} ) where {T} = Array {T,3} (getfield (d,1 ), getfield (d,2 ), getfield (d,3 ))
359
- Array {T,N} (d:: Vararg{Int,N} ) where {T,N} = ccall (:jl_new_array , Array{T,N}, (Any, Any), Array{T,N}, d)
360
- Array {T,1} (m:: Int ) where {T} = ccall (:jl_alloc_array_1d , Array{T,1 }, (Any, Int), Array{T,1 }, m)
361
- Array {T,2} (m:: Int , n:: Int ) where {T} =
353
+ # # primitive Array constructors
354
+ function junk end
355
+ # type and dimensionality specified, accepting dims as series of Ints
356
+ Array {T,1} (:: typeof (junk), m:: Int ) where {T} =
357
+ ccall (:jl_alloc_array_1d , Array{T,1 }, (Any, Int), Array{T,1 }, m)
358
+ Array {T,2} (:: typeof (junk), m:: Int , n:: Int ) where {T} =
362
359
ccall (:jl_alloc_array_2d , Array{T,2 }, (Any, Int, Int), Array{T,2 }, m, n)
363
- Array {T,3} (m:: Int , n:: Int , o:: Int ) where {T} =
360
+ Array {T,3} (:: typeof (junk), m:: Int , n:: Int , o:: Int ) where {T} =
364
361
ccall (:jl_alloc_array_3d , Array{T,3 }, (Any, Int, Int, Int), Array{T,3 }, m, n, o)
362
+ Array {T,N} (:: typeof (junk), d:: Vararg{Int,N} ) where {T,N} =
363
+ ccall (:jl_new_array , Array{T,N}, (Any, Any), Array{T,N}, d)
364
+ # type and dimensionality specified, accepting dims as tuples of Ints
365
+ Array {T,1} (:: typeof (junk), d:: NTuple{1,Int} ) where {T} = Array {T,1} (junk, getfield (d,1 ))
366
+ Array {T,2} (:: typeof (junk), d:: NTuple{2,Int} ) where {T} = Array {T,2} (junk, getfield (d,1 ), getfield (d,2 ))
367
+ Array {T,3} (:: typeof (junk), d:: NTuple{3,Int} ) where {T} = Array {T,3} (junk, getfield (d,1 ), getfield (d,2 ), getfield (d,3 ))
368
+ Array {T,N} (:: typeof (junk), d:: NTuple{N,Int} ) where {T,N} = ccall (:jl_new_array , Array{T,N}, (Any, Any), Array{T,N}, d)
369
+ # type but not dimensionality specified
370
+ Array {T} (:: typeof (junk), m:: Int ) where {T} = Array {T,1} (junk, m)
371
+ Array {T} (:: typeof (junk), m:: Int , n:: Int ) where {T} = Array {T,2} (junk, m, n)
372
+ Array {T} (:: typeof (junk), m:: Int , n:: Int , o:: Int ) where {T} = Array {T,3} (junk, m, n, o)
373
+ Array {T} (:: typeof (junk), d:: NTuple{N,Int} ) where {T,N} = Array {T,N} (junk, d)
374
+ # empty vector constructor
375
+ Array {T,1} () where {T} = Array {T,1} (junk, 0 )
376
+
377
+ # # preexisting Array constructors, i.e. without junk, to deprecate
378
+ # type and dimensionality specified, accepting dims as series of Ints
379
+ Array {T,1} (m:: Int ) where {T} = Array {T,1} (junk, m)
380
+ Array {T,2} (m:: Int , n:: Int ) where {T} = Array {T,2} (junk, m, n)
381
+ Array {T,3} (m:: Int , n:: Int , o:: Int ) where {T} = Array {T,3} (junk, m, n, o)
382
+ Array {T,N} (d:: Vararg{Int,N} ) where {T,N} = Array {T,N} (junk, d)
383
+ # type and dimensionality specified, accepting dims as tuples of Ints
384
+ Array {T,N} (d:: NTuple{N,Int} ) where {T,N} = Array {T,N} (junk, d)
385
+ # type but not dimensionality specified
386
+ Array {T} (m:: Int ) where {T} = Array {T} (junk, m)
387
+ Array {T} (m:: Int , n:: Int ) where {T} = Array {T} (junk, m, n)
388
+ Array {T} (m:: Int , n:: Int , o:: Int ) where {T} = Array {T} (junk, m, n, o)
389
+ Array {T} (d:: NTuple{N,Int} ) where {T,N} = Array {T} (junk, d)
365
390
366
- Array {T} (d:: NTuple{N,Int} ) where {T,N} = Array {T,N} (d)
367
- Array {T} (m:: Int ) where {T} = Array {T,1} (m)
368
- Array {T} (m:: Int , n:: Int ) where {T} = Array {T,2} (m, n)
369
- Array {T} (m:: Int , n:: Int , o:: Int ) where {T} = Array {T,3} (m, n, o)
370
-
371
- Array {T,1} () where {T} = Array {T,1} (0 )
372
391
373
392
# primitive Symbol constructors
374
393
function Symbol (s:: String )
0 commit comments