-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Rename bitstype
or isbits
?
#11822
Comments
Fair point. I don't think "opaque" is the right term though; to me that sounds like |
"value type"? This is a tough naming problem. |
|
What are the exact criteria for |
isbits(t::DataType) = !t.mutable & t.pointerfree & isleaftype(t) # reflection.jl |
Would it be worth considering a larger change to merge the two (immutable i.e. On Tue, Jun 23, 2015 at 2:53 PM, Stefan Karpinski [email protected]
|
I'd be against that, purely from an understandability POV. |
Brainstorming: primtype |
I kind of like @StefanKarpinski 's value type since that's the condition that we can pass the object by value... |
It's also arguable that this is an implementation detail that may change so shouldn't be exposed at all... |
I don't think that's true; we can pass immutable struct types by value as well. However this touches on an important point, which is that |
What |
|
|
|
|
So far I think |
(To be honest, I think that naming conventions in an obscure corner of the language like this are relatively unimportant. But |
@stevengj I don't think though that |
👍 for |
|
So you'd have: |
Maybe something like |
|
I think I like |
well it also has to be immutable so pointerfree does not tell the full story, even if it is the most important criterion for this predicate. As it is now, this predicate is mostly a synonym of is_inlined_into_other_objects and can_be_stack_allocated, and I hope we will soon be able to relax this to include immutables with pointers in it, so that the isbits() thing is less useful. |
That's kind of my feeling – isbits is not going to be a good criterion in the fairly near future. |
True, we might need more detailed predicates, but it is still very useful to check for "plain old data", whose definition is not so implementation-dependent. "Plain old data" is the right term here, it's just weird and ugly. |
Does that include immutability? Is POD necessarily immutable? This seems closer to "value type". |
Yes, IMO that includes immutability, because otherwise the object's identity is effectively a separate piece of data not contained within the |
|
The naming here implies that
isbits
should return true iff the type was defined as abitstype
, but that hasn't been the case since the introduction of immutables. As a result, when one talks about a "bits type," it's not always immediately apparent whether they mean anisbits
type or abitstype
. As one possible suggestion, HDF5 calls types of the kind defined withbitstype
"opaque types."The text was updated successfully, but these errors were encountered: