Bonkers

Aaron Trevena aaron.trevena at gmail.com
Sat May 12 15:45:12 BST 2007


On 12/05/07, Dominic Mitchell <dom at happygiraffe.net> wrote:
> Matt S Trout wrote:
> > On Fri, May 11, 2007 at 11:36:05AM -0700, chromatic wrote:
> >> On Friday 11 May 2007 08:58:51 Peter Corlett wrote:
> >>
> >>> Sure C has objects. They're just called structs, that's all.
> >> Sure C has types.  They're just the number of bits you can read or write
> >> before crashing, that's all.
> >
> > Orthogonal.
> >
> > You should get yourself a copy of TCP/IP Illustrated Volume 2 and look at
> > how the old BSD stack used structs to provide N sets of functions pointers
> > to implement the interface per network device type. Bar the lack of mutability
> > of the keys it's not vastly unlike a package symbol table, at least in terms
> > of -conceptualisation- of OO.
>
> Alternative example: X toolkit intrinsics.  Don't ask me how the hell it
> works, I took one look at the description and ran away screaming.  But I
> did see that it used structs as objects in C.


GTK+ provides faux objects.. fortunately I didn't have to worry about
the implementation and it JustWorked(TM) when I used it in C.

Perversely it was much easier to build a simple GUI app using that
than my more recent attempts using QT and C++.

A.

-- 
http://www.aarontrevena.co.uk
LAMP System Integration, Development and Hosting


More information about the london.pm mailing list