Skip to content

Conversation

@marner2
Copy link
Collaborator

@marner2 marner2 commented Jun 6, 2022

This PR is very similar to #459 in that we take a ref field and convert it to a getter and a setter that has a mutable backing value. This allows us to box/unbox it.

This will conflict with #511 because of it renaming 'value to 't. It's an easy resolution.

@marner2 marner2 force-pushed the feature/change_typed_refs_to_getset branch from 8aea2cd to 3d8f911 Compare June 7, 2022 03:30
@marner2 marner2 marked this pull request as draft June 10, 2022 17:33
@marner2 marner2 force-pushed the feature/change_typed_refs_to_getset branch 5 times, most recently from 447b865 to 348171f Compare June 14, 2022 23:12
@marner2 marner2 force-pushed the feature/change_typed_refs_to_getset branch from 348171f to b0ca18c Compare June 20, 2022 14:03
@marner2 marner2 marked this pull request as ready for review June 20, 2022 14:07
@marner2 marner2 force-pushed the feature/change_typed_refs_to_getset branch from b0ca18c to 761219f Compare June 20, 2022 16:21
@marner2 marner2 force-pushed the feature/change_typed_refs_to_getset branch from 761219f to 713e8f9 Compare June 23, 2022 23:26
@marner2 marner2 mentioned this pull request Jun 27, 2022
41 tasks
@marner2 marner2 force-pushed the feature/change_typed_refs_to_getset branch 4 times, most recently from 3d515e2 to 3b828cb Compare July 1, 2022 00:25
@marner2 marner2 force-pushed the feature/change_typed_refs_to_getset branch 7 times, most recently from f9bc17b to feb8125 Compare July 11, 2022 19:56
@marner2 marner2 force-pushed the feature/change_typed_refs_to_getset branch 3 times, most recently from f12c650 to 94d34c9 Compare July 18, 2022 20:50
@marner2 marner2 force-pushed the feature/change_typed_refs_to_getset branch 2 times, most recently from f9aea41 to 297220f Compare July 23, 2022 14:50
@marner2 marner2 force-pushed the feature/change_typed_refs_to_getset branch from 297220f to a1a3e11 Compare August 6, 2022 21:06
@marner2 marner2 force-pushed the feature/change_typed_refs_to_getset branch from a1a3e11 to 7de9905 Compare August 6, 2022 22:11
@marner2 marner2 force-pushed the feature/change_typed_refs_to_getset branch from 7de9905 to 3f45429 Compare August 15, 2022 16:58
@marner2 marner2 marked this pull request as draft August 17, 2022 13:09
@marner2 marner2 force-pushed the feature/change_typed_refs_to_getset branch 2 times, most recently from 01c145c to 497d142 Compare September 7, 2022 03:09
@marner2 marner2 marked this pull request as ready for review September 7, 2022 03:11
@marner2 marner2 force-pushed the feature/change_typed_refs_to_getset branch from 497d142 to 309c99c Compare September 9, 2022 01:04
@TysonMN
Copy link
Member

TysonMN commented Sep 11, 2022

This allows us to box/unbox it.

This seems possible to me.

Can you be more specific about what doesn't work?

@marner2
Copy link
Collaborator Author

marner2 commented Sep 12, 2022

@TysonMN you can't box/unbox a ref value because in doing so, you will create a "new" ref which won't be set if anyone with the "old" ref assigns to it. There's no way to put something "between" a ref set and it assigning the value. However with get/set functions we can easily do this.

@marner2 marner2 force-pushed the feature/change_typed_refs_to_getset branch from 309c99c to 72c0684 Compare September 12, 2022 17:02
@TysonMN TysonMN force-pushed the feature/change_typed_refs_to_getset branch from 72c0684 to 177a5f5 Compare September 16, 2022 01:10
@TysonMN
Copy link
Member

TysonMN commented Sep 16, 2022

@TysonMN you can't box/unbox a ref value because in doing so, you will create a "new" ref which won't be set if anyone with the "old" ref assigns to it. There's no way to put something "between" a ref set and it assigning the value. However with get/set functions we can easily do this.

Yes. And I was thinking that would be ok; that there isn't anywhere that would have a reference to the old ref.

Even so, I like your change. I think using functions is more convincingly correct.

@TysonMN TysonMN merged commit 23489b1 into elmish:master Sep 16, 2022
@marner2 marner2 deleted the feature/change_typed_refs_to_getset branch September 16, 2022 16:02
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

Successfully merging this pull request may close these issues.

2 participants