-
-
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
Renaming Ref #18990
Comments
I don't agree with those comments in either of those issues. Both of them seem to be trying to code against I can see that it is possible we should have two levels of Ref describing whether something is a c-compatible reference (ptr-convertable) or a heap-allocated/gc-managed reference. This could be |
The abstract type should be used in case where all these types are designed for. There s also the different use case for a mutable slot (I.e. a cheaper zero dimensional array) and it just happens that refvalue is the one that satisfies the requirements. |
That's probably where the tension comes from. The need of that behavior in some places, the fact that there's already a type that behaves that way (but it's embedded into a type hierarchy envisioned for other uses) and the discomfort of duplicating code / defining a new type gives rise to these conflicting opinions. So a possible solution might need flexibility on one of these two fronts. Irrespectively of that, I believe that the idea of introducing another level to distinguish c-compatible and gc-managed references is a good idea anyway. I like the |
Another option is to allow uses of |
@yuyichao If
There is a NULL pointer, and |
Another possibility: rename |
To summarize discussion:
|
|
Yes, both. |
So how do you express
|
|
That becomes quite annoy. Also the case for return type..... |
Using Ref as an implicit unsafe_load is a pretty rare thing to do though. Don't think I've personally ever used it that way. |
Explictly as implicit |
Note that the code linked works for both mutable and immutable objects. |
Would be good to have an owner for this one if it is to make feature freeze? |
Do we have a timeline for feature freeze? |
It was said on slack that it would be in a bit less than 3 weeks. |
This is a good thing to announce on discourse. Some of us don't use slack. |
@KristofferC just suggested there the same a couple of hours ago! |
I think a final call has yet to be taken as some folks think it isn't enough time. |
This doesn't seem important enough to bother with. The current system is a little confusing, but it works and no one has seen fit to fix it in a year. |
As pointed out here #11430 (comment), here #11430 (comment) and in some of the comments on that issue, the naming convention for
Ref
andRefValue
is probably not the best and causes some confusion.I'd like to propose the following changes
Ref
->CRef
,ARef
(A for Abstract) orByRef
(proposed by @JeffBezanson)RefValue
->Ref
(and export this)and leaving
RefArray
as it is.As pointed out by @vtjnash, most of the time what people need is the abstract version, but for #11430 and #18965 having
Ref
to meanRefValue
would be more convenient.Also, quoting @StefanKarpinski
The text was updated successfully, but these errors were encountered: