GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Class inheritance example · Issue #2800 · lcompilers/lpython Open DescriptionWe should implement runtime polymorphism, using virtual function tables. Here is the simplest example: # Base class class A: def myprint(): print("A") def f(a: A): a.myprint() The function # subclass class B(A): def myprint(): print("B") def main(): a: A = A() b: B = B() c: B = B() f(a) f(b) f(c) The call Steps to get it implemented:
Note: the instances To be figured out: it is not clear when this virtual function table is created. One option is at start time of the program. Another option is at the first instantiation of Activity
MetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |