The role of DataValue#id #75
Unanswered
mtf90
asked this question in
AutomataLib Q & A
Replies: 1 comment 2 replies
-
|
I would be in favor of decoupling |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm currently trying to clean up generic type definitions and wanted to make the
DataTypeclass typed according to its given base typeClass<T>. I assume the intention is that upon creating aDataValue(type, id)theidshould always match the specified type?The problem I encountered is that
Parameters (orSymbolicDataValues in general) are implemented asDataValue<Integer>. Now, for example, theParValuationconstructs from a given (word of)PSymbolInstanceparameters using the symbol'sDataValue<?>types but assigns to it an integer id which causes the compiler to complain (rightfully so, because instantiated symbols may reference non-integer types).Throughout the code, I have only found calls to
DataValuethat set a numeric value for theidfield, so would anint idfield be more appropriate? This would mean that we expect users to encode parameter values with a symbolic identification themselves. If arbitrary (but apparently unrelated) types should be supported, maybeObjectwould be a better fit than a generic type? In this case, given the discussion #73, what remaining use does the base class have, if the name alone seems to be the primary identifier for a type? Or should the currentSymbolicDataValueimplementation be decoupled fromDataValues?Beta Was this translation helpful? Give feedback.
All reactions