Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should there be a "top" type, root of the class hierarchy #180

Closed
jeromesimeon opened this issue Mar 10, 2020 · 3 comments
Closed

Should there be a "top" type, root of the class hierarchy #180

jeromesimeon opened this issue Mar 10, 2020 · 3 comments

Comments

@jeromesimeon
Copy link
Member

Should there be a root of the type hierarchy, akin to Object in many object-oriented languages.

Currently each different kind of class has it's own root Asset for assets, Event for events, etc.

Having a root for the type hierarchy has a number of benefits, most notably when used in the context of a programming language using CTO (as Ergo is). See for instance the related Ergo issue accordproject/ergo#420

A possible way to achieve this is to use one of the existing classes, most probably Concept as the top of the hierarchy.

A possible corresponding definition for the systems types would become (in addition to the changes already included in the release-1.0 branch):

namespace system
abstract concept Concept {  }
abstract asset Asset extends Concept {  }
abstract transaction Transaction extends Concept { }
abstract event Event extends Concept { }
abstract participant Participant extends Concept {  }
@dselman
Copy link
Contributor

dselman commented Jun 30, 2020

I think we have addressed this now in #181 - do you agree?

@jeromesimeon
Copy link
Member Author

I think so too!

I am wondering how we decide that it is? Is there any "subtype(Type1, Type2)" call in the API. Or "instanceof(Value,Type)" call in the API?

@dselman
Copy link
Contributor

dselman commented Jul 6, 2020

These changes have been merged to the release-1.0 branch.

@dselman dselman closed this as completed Jul 6, 2020
Cicero + Ergo 1.0 automation moved this from Priority: High to Finished Issues Jul 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Cicero + Ergo 1.0
  
Finished Issues
Development

No branches or pull requests

2 participants