comp.lang.ada
 help / color / mirror / Atom feed
From: Hyman Rosen <hyrosen@mail.com>
Subject: Re: A curiosity...
Date: Thu, 04 Dec 2008 17:57:24 -0500
Date: 2008-12-04T17:57:24-05:00	[thread overview]
Message-ID: <pfZZk.25421$Jl5.18494@newsfe19.iad> (raw)
In-Reply-To: <gh9lmk$hih$1@munin.nbi.dk>

Randy Brukardt wrote:
> Every C-language interface that I've every used is
 > full of hacks to get around strong typing.
 > ...
 > Perhaps C programmers are so used to cruft that they
 > fail to abstract it away properly, but that reflects
 > more on the programmers (and the culture that they
 > work it) than the language.

I don't think that's particularly fair, or right.
The main issue that the sample exposes is that when
you have a library which needs to accept user objects
and pass them back into user code, it's going to be
difficult to define the interface properly without a
lot of mechanism.

It really is the case that all pthread_create wants
to do with that pointer is hand it back once it starts
the thread. I expect that in modern C++, this would
get wrapped in template code to make sure that the
type of the pointer passed matches the argument type
of the thread function, and I guess Ada would use
generics similarly, but in a C interface, you just do
the cast and leave it at that.



  reply	other threads:[~2008-12-04 22:57 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-04 20:47 A curiosity mockturtle
2008-12-04 21:17 ` Adam Beneschan
2008-12-04 21:48   ` Hyman Rosen
2008-12-04 22:04     ` Ludovic Brenta
2008-12-04 22:10       ` Ludovic Brenta
2008-12-04 22:24         ` Hyman Rosen
2008-12-05  8:02         ` Samuel Tardieu
2008-12-05 11:51           ` Peter C. Chapin
2008-12-05 13:09           ` Martin Krischik
2008-12-05 15:15             ` Hyman Rosen
2008-12-06 13:26             ` Peter C. Chapin
2008-12-05 16:37           ` Keith Thompson
2008-12-04 22:19       ` Hyman Rosen
2008-12-05  9:03       ` Georg Bauhaus
2008-12-04 22:30 ` Randy Brukardt
2008-12-04 22:57   ` Hyman Rosen [this message]
2008-12-05 16:42     ` Keith Thompson
2008-12-05 16:57       ` Hyman Rosen
2008-12-05 20:20         ` Keith Thompson
2008-12-05 20:59           ` Adam Beneschan
2008-12-06 22:53             ` Hyman Rosen
2008-12-06 23:15               ` Gary Scott
2008-12-08 15:39                 ` Hyman Rosen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox