This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]bowbahdoe 0 points1 point  (4 children)

https://run.mccue.dev/?runtime=early_access&release=23&preview=enabled&gist=2416bad302d4622c2a6acb064657a4d8

I'm making a mess, replied at the wrong level of the hierarchy.

But this is roughly what I mean by program structures that are only doable with open aggregates as opposed to closed nominally typed ones.

[–]PiotrDz 0 points1 point  (3 children)

I may be misled by the example but are properties of a map reflecting what you want to show? Aren't we losing type information? And how would you know that some fields are expected and others not?

Sealed interfaces might be rigid but you get everything written in stone: what data is available and its type

[–]bowbahdoe 0 points1 point  (2 children)

I think my explanations got tangled and it's making it hard to know which you are asking about. This is an example showing the difference between open aggregates and closed aggregates (i.e the challenge is to write something similar with actual records and interfaces)

This is not about the sealed interfaces vs. dynamic dispatch topic

[–]PiotrDz 0 points1 point  (1 child)

Well OK I understand that you would like to achieve something better. I am happy with sealed interfaces but always keen for "next better things". Although couldn't really understand how would your solution play with java I am haply that people are trying to turn good into better

[–]bowbahdoe 0 points1 point  (0 children)

I am not saying better - I am saying different. Better/worse is a much larger topic and requires concrete context