Skip to content

Removes IDreamList, Embraces OOP - #2735

Open
Kapu1178 wants to merge 78 commits into
OpenDreamProject:masterfrom
Kapu1178:101926IDreamListRefactor
Open

Kapu1178 wants to merge 78 commits into
OpenDreamProject:masterfrom
Kapu1178:101926IDreamListRefactor

Conversation

@Kapu1178

Copy link
Copy Markdown
Contributor

Relies on #2729

This is a big one. This PR removes IDreamList, and restructures the DreamList objects to better recycle behavior, reduce wasteful allocations, and introduce optimization routes.

Structural Changes

  • DreamList is now an abstract parent class to the other list classes.
  • DreamEagerList is a new abstract parent class for types that manage their contents in an eager list, like the old DreamList.
  • The old DreamList is now known as a DantomList due to it's "QUIRKS", and represents user-space made list structures.
  • DreamAssocList is effectively unchanged, now deriving from DreamList.
  • All of the previous children of DreamList derive from the new abstract form, or DreamEagerList, if applicable.

Method Changes

  • Added ToDantomList(), most of the time you're working with varying list types you will return a DantomList anyway.
  • Added EnumerateLoosePairs() (needs new name, probably), a function for enumerating key-value pairs. If the given Key has no Value, it is set to DreamValue.Null.
  • Added EnumerateTightPairs() (needs new name too), a function also for enumerating key-value pairs. However, this one outright excludes keys with no associated value.
  • Added GetLoosePairs() and GetLooseKeys() as helpers for the above.
  • Renames GetKeys() to CopyKeys(), as that's what it does.
  • Added TryGetElementByKey()
  • Added TryGetElementByIndex()

@boring-cyborg boring-cyborg Bot added the Runtime Involves the OpenDream server/runtime label Oct 19, 2026
@Kapu1178
Kapu1178 marked this pull request as ready for review October 19, 2026 22:49

@github-advanced-security github-advanced-security AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

InspectCode found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Runtime Involves the OpenDream server/runtime size/XXL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants