D isn't the only language with janky closure semantics
H. S. Teoh
hsteoh at qfbox.info
Sat Aug 30 21:10:59 UTC 2025
On Sat, Aug 30, 2025 at 07:33:43PM +0000, monkyyy via Digitalmars-d wrote:
> On Saturday, 30 August 2025 at 18:43:49 UTC, H. S. Teoh wrote:
> > On Sat, Aug 30, 2025 at 05:20:18PM +0000, Konstantin via Digitalmars-d
> > wrote:
> > > Why are delegates in D an aggregate of a context pointer and a
> > > function pointer, not like C++'s lambdas (anonymous class with
> > > `operator()`)?
> >
> > That's just an implementation issue. I think the original intention
> > is to unify them with class member function pointers, or something
> > like that.
[...]
> Is it not a #wontfix?
Whether or not it's a #wontfix, I'm gonna keep complaining until it gets
fixed. ;-)
The current behaviour is pretty much completely useless 100% of the
time, so in keeping with D's philosophy of catering to the most common
use cases, this should be fixed. It doesn't make sense that we have to
work around this every single time, when it doesn't even serve a single
useful use case.
T
--
Designer clothes: how to cover less by paying more.
More information about the Digitalmars-d
mailing list