Inheritance/Multiple: Difference between revisions
Content deleted Content added
Line 652:
{{omit|Julia}}
=={{header|Julia}}==
Julia supports inheritance via abstract types. In Julia, multiple dispatch allows objects of different types to have the same function interfaces. Julia also can support traits via parameters in type declarations or with macros. This makes multiple inheritance in Julia mostly unnecessary, except for the inconvenience of composing the data in a mixed type when declaring multiple similar types, for which there are macros.<br /> <br />For example, the functions <code> scan(equipment, sheet) </code> and <code> lineprint(equipment, file) </code> could be used as generic interfaces to implement methods for a <code>Printer</code>, a <code>Scanner</code>, and a <code>MultiFunctionPrinter</code>, and Julia would dispatch according to the type of the equipment.
|