arsd 10.1, thought on virtual functions, community announces light weight Druntime 0.3 among others

Posted 2021-06-21

just docs: arsd 10.1, thought on virtual functions, community announces light weight Druntime 0.3 among others

Core D Development Statistics

In the community

Community announcements

See more at the announce forum.

What Adam is working on

arsd 10.1 tagged this week, with a few more little things: dom.d's toPrettyString can now be customized as to which elements it considers inline (set the list to the document after you construct it), minigui added ClosingEvent and ClosedEvent - ClosingEvent is your chance to cancel the close if the user wants to save their files, etc, and ClosedEvent is fired when the window is already closed but you might need to clean up. I also added a Button constructor overload that takes an ImageLabel, which is image + text to display inside it.

I think I've settled into about one feature release a month, then a breaking batch queued up every six months (of course I always aim to minimize breakage anyway), then bug releases as needed. It seems to work ok.

Random thought

I think it is often a good idea for virtual functions to take a struct as their argument instead of separate args. This way, adding one can be done centrally, without requiring all the child classes to update their arguments too.

On the other hand, of course, you might WANT the compiler to tell child class implementers about the new argument so they can handle it. But if they just forward it back to super(), putting it in a struct gives a lot of convenience.

Whenever I do this, I tend to be happy with it, and when I don't, I sometimes regret it later. So I'm starting to think it might be a good idea, even if I might not actually need it later.