These are the core constructors for Array on master:
-
The constructor methods that accept the dimensions as a series of
Ints (as opposed to a tuple ofInts) come first, and they’reeval-ed intoCore. Why the use ofevalthere, but not for the other constructor methods, below? EDIT: oh, I guess this is because they requirenewto be used. -
I’m surprised that there’s so much code duplication? Is it necessary, or would it be possible to introduce additional helper functions to deduplicate the code?
-
Why use
getfield(d, 1), getfield(d, 2), getfield(d, 3), instead of justd...? Is this because of some special performance considerations that affect only bootstrapping?
I’m wondering about these issues because I want to fix a bug, but fixing it seems to require adding more of these core constructor methods to base/boot.jl. Github issue: