ECS macro improvements #119
Labels
META:internal
Created by Billy
RE:ECS
Something within the ECS module
SIZE:medium
Conceptually easy but bigger in scope/conceptually hard but small in scope/medium in both
TYPE:enhancement
Adding something new to B+
1.CONSTRUCT_DEFAULT
automatically defines aCONSTRUCT()
which takes each field as a parameter.2.CONSTRUCT_MANUAL
gives you much more flexibility with the type signature by requiring you to manually invoke the super-type's constructor withSUPER()
.3. Allow for component type parameters.4. Allow for setting a field's initial value with @kwdef-like syntax, turning it from an ordered parameter to a named parameter
5. Allow child components to have an implicit constructor while their parents have explicit (just add the child fields as extra arguments, and peel them off when calling the parent constructor)
6. Combine doc-strings for fields and promises/configurables into the component's own doc-string
@component
helps us out here: take the doc-string as a normal macro parameter and turn it into a@doc
call in the emitted code.8. Check that implemented promises and configurations have the same type signature as the original (for parameter typing, automatically insert the correct type if none is provided; otherwise assert the provided type is <: the original type)NOTE: This is no longer considered useful. Instead, child implementations are totally allowed to offer different type parameters than their parents, and both child and parent participate in overload resolution (with children usually having priority).final
so that children can't override them.print()
, for example making it multi-line with each field tabbed inThe text was updated successfully, but these errors were encountered: