[clug] Object-Oriented C?

David Gibson david at gibson.dropbear.id.au
Wed Feb 22 04:55:01 GMT 2006


On Wed, Feb 22, 2006 at 03:47:04PM +1100, Martin Pool wrote:
> On 22 Feb 2006, David Gibson <david at gibson.dropbear.id.au> wrote:
> 
> > On Wed, Feb 22, 2006 at 01:17:06PM +1100, Paul Wayper wrote:
> > There's nothing "pseudo" about your approach.  The object-orientation
> > is in how you organize your data and code with respect to each other,
> > not in the mere syntactic sugar of whether you need to explicitly pass
> > the "self" object to a method.  
> 
> Hear hear.
> 
> > (Note for example that in Python, the
> > implementation of each method sees 'self' as an explicit, named,
> > parameter; instance.method(...) is exactly equivalent to explicitly
> > calling class.method(instance, ...) ).
>  
> By way of trivia: they're very similar but not exactly the same.  In
> particular in the first case Python will first search the instance for
> the 'method' name, which means it can match something specific to the
> instance, and will invoke the instance's __getattr__ method if it has
> one.  (One can, for example, have per-instance rather than per-class
> methods.)  As you say in either case the instance is the first argument.  

Oh.. yes.. I should have remembered that :-/

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.samba.org/archive/linux/attachments/20060222/c3c05ad4/attachment.bin


More information about the linux mailing list