[libre-riscv-dev] [Bug 64] data handling / io control / data routing API needed

bugzilla-daemon at libre-riscv.org bugzilla-daemon at libre-riscv.org
Fri Apr 26 20:26:31 BST 2019


http://bugs.libre-riscv.org/show_bug.cgi?id=64

--- Comment #14 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(In reply to Jacob Lifshay from comment #12)
> (In reply to Luke Kenneth Casson Leighton from comment #10)
> > it's sufficiently important to ask, can you raise a bugreport on github
> > about it
> https://github.com/m-labs/nmigen/issues/65

Sigh the correct solution is to use ABCs or duck typing (technique used in c++
RTTI), as can be found by googling in many many discussions as to why type
should be the absolute last redort.

The introduction of a function or property in the base lass that each
derivative sets to uniquely identify itself, that is the right solution.  An
integer (enum) would be the fastest way as it is right at the top of the python
FORTH-like interpreter in the c code.

Although, an enum would not be extensible unless the enum itself was dynamic.

Or, ABCs apparently can be used to do the same thing, although I hazard a guess
nowhere near as fast as using an integer ducktype would be.

class Value:
    def __init__ ...
        self.nmtype = 1 # or an enum

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-riscv-dev mailing list