www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - SwiftUI Property Wrappers / Possible in D?

reply =?iso-8859-1?Q?Robert_M._M=FCnch?= <robert.muench saphirion.com> writes:
See: 
https://swiftwithmajid.com/2019/06/12/understanding-property-
rappers-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
Apr 28
parent reply Adam D. Ruppe <destructionator gmail.com> writes:
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.
Apr 29
parent =?iso-8859-1?Q?Robert_M._M=FCnch?= <robert.muench saphirion.com> writes:
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
Apr 29