You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the lack of symbols for property/signal names has 3 drawbacks:
unused import warnings for dependencies
typos in property paths lead to errors
forgetting dependencies
Therefore, the following set of ravestate API changes should be introduced:
§0 Properties may be constructed like my_prop = PropertyBase(...) in a with Module(...) clause, module scope is assigned automatically. Dependencies may then use my_prop.
§1 Signal can be constructed in with Module ... clause, module scope will be set automatically. Signal may be used as parameter signal=my_signal in state declaration
§2 Referring to signals by name should become illegal. The s(...) function will be removed. Refer either by exported module variable, or by the respective Property/State APIs.
§3 Setting Signal constraint properties like min_age, max_age, detached, will be moved from constructor parameters to chainable function calls: my_signal.min_age(30).detached(). Each function call returns a copy of the signal with the respective member value change.
§4 Properties will be referrable by symbols. The context's push/pop/setitem/getitem functions will be changed accordingly.
§5 It should be prevented, that developers call a property's read/write function directly. For this purpose, context should always adopt copies of the respective property objects. The originals will be untouched. An exception to this rule is generally made for child properties, since they mark an advanced use-case where properties are generally created dynamically, and usually accessed through their path anyway.
§6 The PropertyBase class will be renamed to Property.
The text was updated successfully, but these errors were encountered:
Currently, the lack of symbols for property/signal names has 3 drawbacks:
Therefore, the following set of ravestate API changes should be introduced:
my_prop = PropertyBase(...)
in awith Module(...)
clause, module scope is assigned automatically. Dependencies may then usemy_prop
.Signal
can be constructed inwith Module ...
clause, module scope will be set automatically. Signal may be used as parametersignal=my_signal
in state declarations(...)
function will be removed. Refer either by exported module variable, or by the respective Property/State APIs.min_age
,max_age
,detached
, will be moved from constructor parameters to chainable function calls:my_signal.min_age(30).detached()
. Each function call returns a copy of the signal with the respective member value change.PropertyBase
class will be renamed toProperty
.The text was updated successfully, but these errors were encountered: