Expands SetReplaceType to now accept up to two arguments: SetReplaceType[name, version].
It is now used not only in type graphs but everywhere: SetReplaceObjectType returns it, Multihistory types use it, etc.
objectType can return types wrapped in SetReplaceType or not. However, types will be wrapped automatically once they reach any user-facing functions or other declarations such as declareTypeTranslation (in other words, SetReplaceType[name] can be used interchangeably with name).
There are custom boxes for SetReplaceType:
SetReplaceTypeConvert can accept types without versions, e.g., SetReplaceTypeConvert[WolframModelEvolutionObject] @ object. In this case, the latest known type is used.
Comments
It is a bit awkward (although somewhat unrelated to this PR) that multihistory types use the same symbols as corresponding systems. One would think it would make more sense to use types like MultisetSubstitutionMultihistory, etc.
However, if we do that, Multihistory will look weird because the word 'multihistory' will be repeated twice: in the Head and in the top raw of the object details:
We can alternatively move that name to the 'Head' part
but I think we want to keep the head in boxes consistent with the real head.
If we then do in fact use different heads for different multihistories, it will make them harder to implement, since one will have to implement objectType, usage, etc. for each one.
So, given all that, I'm keeping the type names the same.
[Done] Should we add any extra styling to the boxes so that it does not look exactly like the original type name, especially if no version is specified?
Examples
Types now have the new formatting everywhere:
Even in $SetReplaceTypeGraph:
In[] := $SetReplaceTypeGraph
And conversions can be done without specifying a version:
Although specifying the version explicitly is still allowed:
Changes
SetReplaceType
to now accept up to two arguments:SetReplaceType[name, version]
.SetReplaceObjectType
returns it,Multihistory
types use it, etc.objectType
can return types wrapped inSetReplaceType
or not. However, types will be wrapped automatically once they reach any user-facing functions or other declarations such asdeclareTypeTranslation
(in other words,SetReplaceType[name]
can be used interchangeably withname
).SetReplaceType
:SetReplaceTypeConvert
can accept types without versions, e.g.,SetReplaceTypeConvert[WolframModelEvolutionObject] @ object
. In this case, the latest known type is used.Comments
It is a bit awkward (although somewhat unrelated to this PR) that multihistory types use the same symbols as corresponding systems. One would think it would make more sense to use types like
MultisetSubstitutionMultihistory
, etc.However, if we do that,
Multihistory
will look weird because the word 'multihistory' will be repeated twice: in theHead
and in the top raw of the object details:We can alternatively move that name to the 'Head' part
but I think we want to keep the head in boxes consistent with the real head.
If we then do in fact use different heads for different multihistories, it will make them harder to implement, since one will have to implement
objectType
, usage, etc. for each one.So, given all that, I'm keeping the type names the same.
[Done] Should we add any extra styling to the boxes so that it does not look exactly like the original type name, especially if no version is specified?
Examples
Types now have the new formatting everywhere:
Even in
$SetReplaceTypeGraph
:And conversions can be done without specifying a version:
Although specifying the version explicitly is still allowed:
This change is