Editions Ideas
Adam D. Ruppe
destructionator at gmail.com
Wed Dec 24 18:10:52 UTC 2025
On Wednesday, 24 December 2025 at 15:29:18 UTC, Kapendev wrote:
> No idea about `@property`, but here are some things I like
> about OpenD:
What I'd specifically like to do with `@property`, but note that
I have tried and failed to implement it twice over the years, so
don't hold your breath, is, in order of priority:
1) Make it so `struct A { @property Callable foo(); }` works when
you do `A a; a.foo();` so that calls the returned callable, not
just gets it. Currently, to call the returned callable, you must
do `a.foo()();` which shatters the illusion.
If this alone could change, I'd be pretty happy!
2) Make it so a getter/setter pair is called when you do `a.prop
+= 5;`. Ideally, this would automagically call `a.prop(a.prop +
5)`.
This is just a nice to have sometimes, but if we can make it so,
that'd be cool. Some people will argue this breaks the atomic
assumption of +=, but tbh you shouldn't assume += is atomic in
the first place, so meh.
3) I'm not in love with the typeof(a.prop) thing but im not sure
it is worth changing even if we limited the breakage so .... idk.
I think this is it, I'm sure I've written about this a few times
on the blog, but I don't even have to check to say #1 is what I
actually *want* from `@property` and #2 would sometimes be nice.
Everything else is meh.
I absolutely do NOT want to change the current behavior of
optional parenthesis on non-property functions and I do NOT care
about `writeln = 5`. Like whatever.
More information about the Digitalmars-d
mailing list