Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What to do with Array now that it has fields ? #87

Open
longemen3000 opened this issue Jul 16, 2024 · 6 comments
Open

What to do with Array now that it has fields ? #87

longemen3000 opened this issue Jul 16, 2024 · 6 comments

Comments

@longemen3000
Copy link
Contributor

while testing #86 , some downstream packages (Flatten.jl) fail because now Array{N,T} has fields (size::NTuple{Int,N} and ref::MemoryRef{T}). is this something that needs to be fixed on Flatten or ConstructionBase?

@jw3126
Copy link
Member

jw3126 commented Jul 16, 2024

We have getproperties([]) == () so getproperties and setproperties should be consistent with that, e.g. not see the fields. About constructorof and getfields should be aware of them OTOH.
See also

@rafaqz
Copy link
Member

rafaqz commented Jul 16, 2024

Does the constrictor Array(size, ref) work?

And do you have a link to the break in Flatten.jl?

(We may need a costom constructorof here)

@jw3126
Copy link
Member

jw3126 commented Jul 16, 2024

Does the constrictor Array(size, ref) work?

No, Array(ref, size) does not work. Still, I think we should provide it. To me, one aspect of this package is to provide a constructor from fields no matter what. We do this in many other cases even lambda functions.

@rafaqz
Copy link
Member

rafaqz commented Jul 16, 2024

Yeah, absolutely. We can define a custom constructorof for Array.

@aplavin
Copy link
Member

aplavin commented Jul 16, 2024

provide a constructor from fields no matter what

Yes, nice to have it whenever possible. Ie, constructorof(array)(getfields(A)) won't work on 1.10- because it doesn't have any fields, but will on 1.11.

@rafaqz
Copy link
Member

rafaqz commented Jul 16, 2024

Yeah, it will need to be in a @static check on Julia version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants