<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Multiple Inheritance Considered Awesome</title>
	<link>http://lucumr.pocoo.org/cogitations/2008/03/03/multiple-inheritance-considered-awesome/</link>
	<description>Armin Ronacher thinking</description>
	<pubDate>Sat, 11 Oct 2008 12:07:26 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2</generator>

	<item>
		<title>By: James</title>
		<link>http://lucumr.pocoo.org/cogitations/2008/03/03/multiple-inheritance-considered-awesome/#comment-2584</link>
		<author>James</author>
		<pubDate>Mon, 03 Mar 2008 22:11:23 +0000</pubDate>
		<guid>http://lucumr.pocoo.org/cogitations/2008/03/03/multiple-inheritance-considered-awesome/#comment-2584</guid>
		<description>This sounds reminiscent of the Ecma script 4 'like' syntax:

type Point = { x:int, y:int } // this isn't a class, just a description of a possible type
class MyClass { public var x:int; public var y:int; }
function acceptPoint( aPoint like Point ){ /* do something */ }
var aPointLikeThing:MyClass = new MyClass;
acceptPoint( aPointLikeThing );

In this case there is a difference between that which is a true subclass (e.g. instanceof which is an Ecma script 4 operator as well) and that which is just 'like' a particular type description.  This gets pretty cool with unions of types, where you can specify a type identifier as being anyone of a number of types, e.g:

type AnyNumber = (byte,int,uint,double,decimal,Number)

check out: http://www.ecmascript.org/es4/spec/overview.pdf

This is the most interesting addition to a language I have seen in quite some time and I am truly excited about it.  In an optionally typed language (like es4) it provides compiler checking and a high level of polymorphism without requiring Interfaces and sub-classing.

To see this added to Python is a real pleasure since it is my newly adopted second language.</description>
		<content:encoded><![CDATA[<p>This sounds reminiscent of the Ecma script 4 &#8216;like&#8217; syntax:</p>
<p>type Point = { x:int, y:int } // this isn&#8217;t a class, just a description of a possible type<br />
class MyClass { public var x:int; public var y:int; }<br />
function acceptPoint( aPoint like Point ){ /* do something */ }<br />
var aPointLikeThing:MyClass = new MyClass;<br />
acceptPoint( aPointLikeThing );</p>
<p>In this case there is a difference between that which is a true subclass (e.g. instanceof which is an Ecma script 4 operator as well) and that which is just &#8216;like&#8217; a particular type description.  This gets pretty cool with unions of types, where you can specify a type identifier as being anyone of a number of types, e.g:</p>
<p>type AnyNumber = (byte,int,uint,double,decimal,Number)</p>
<p>check out: <a href="http://www.ecmascript.org/es4/spec/overview.pdf" rel="nofollow">http://www.ecmascript.org/es4/spec/overview.pdf</a></p>
<p>This is the most interesting addition to a language I have seen in quite some time and I am truly excited about it.  In an optionally typed language (like es4) it provides compiler checking and a high level of polymorphism without requiring Interfaces and sub-classing.</p>
<p>To see this added to Python is a real pleasure since it is my newly adopted second language.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
