Thread overview
SwiftUI Property Wrappers / Possible in D?
Apr 28, 2020
Robert M. Münch
Apr 29, 2020
Adam D. Ruppe
Apr 29, 2020
Robert M. Münch
April 28, 2020
See: https://swiftwithmajid.com/2019/06/12/understanding-property-wrappers-in-swiftui/ 


I'm wondering, would something like this behaviour be possible with CTFE and UDAs? Getting a reactive infrastructure which can be used in a least invasive way would be a nice pattern/feature. Same for handling global state and propagating state changes.

-- 
Robert M. Münch
http://www.saphirion.com
smarter | better | faster

April 29, 2020
On Tuesday, 28 April 2020 at 20:48:59 UTC, Robert M. Münch wrote:
> I'm wondering, would something like this behaviour be possible with CTFE and UDAs?

I just skimmed it but I'm pretty sure yes, and in fact we can probably do it with almost the same syntax since there appears to be an extra ui layer processing it which is exactly what D would need to pull it off.
April 29, 2020
On 2020-04-29 13:42:24 +0000, Adam D. Ruppe said:

> On Tuesday, 28 April 2020 at 20:48:59 UTC, Robert M. Münch wrote:
>> I'm wondering, would something like this behaviour be possible with CTFE and UDAs?
> 
> I just skimmed it but I'm pretty sure yes, and in fact we can probably do it with almost the same syntax since there appears to be an extra ui layer processing it which is exactly what D would need to pull it off.

Thanks for checking it out and good to see you have the same impression.

My D skills are most likely way to weak from being able to do a prototype. Since I'm using RX for all the reactive stuff at the moment, I'm not sure if it makes sense to utilize it or go a different route. Same for the global state stuff, which could be handled by a Redux lib.

IMO getting such fundamental patterns in a idomatic way into Phobos would be a good step. Such things shouldn't be invented over and over again.

-- 
Robert M. Münch
http://www.saphirion.com
smarter | better | faster