Proper instance and class methods #366
Labels
bb: major
Major issue according to bug bounty categorization
bug bounty
This issue is prized out as part of the Bug Bounty Program
enhancement
New feature or request
Is your feature request related to a problem? Please describe.
Currently classes in OpShin do not support methods. It would be nice to support methods. Especially magic methods (
__add__
) would improve the situation of i.e. Fractions etc.Describe the solution you'd like
Users should be able to declare methods on PlutusData classes which will be dispatched to when called from OpShin code.
Describe alternatives you've considered
None
Additional context
Note that this might be more complex than it seems. In particular, the functions should be (C-Style) compiled and mapped somewhere global-statically, then called instead of the attribute accessed (one option). Note also that OpShin does currently not permit inheritance (and does not plan to) which should improve the situation.
The text was updated successfully, but these errors were encountered: