Describe processes as type transformations, with inference that supports subtypes and parametric polymorphism. Create and query corresponding transformation graphs.
The recommended way of defining a language either via scope:
A = TypeOperator()
cct = Language(scope=locals())
... or via properties:
cct = Language()
cct.A = TypeOperator()
... both have issues. You need to remember to define the namespace only after you've defined everything else. In the first, there's loose wiring in the use of locals(); in the second, you need to be very verbose, referencing the Language in every definition and in every typing.
The recommended way of defining a language either via scope:
... or via properties:
... both have issues. You need to remember to define the namespace only after you've defined everything else. In the first, there's loose wiring in the use of
locals()
; in the second, you need to be very verbose, referencing theLanguage
in every definition and in every typing.Using decorators would solve this: