develooper Front page | perl.perl6.language.data | Postings from August 2000

Re: 122 (v1): types and structures

Thread Previous | Thread Next
From:
Tom Christiansen
Date:
August 24, 2000 11:00
Subject:
Re: 122 (v1): types and structures
Message ID:
6819.967140016@chthon
>Tom Christiansen wrote:

>> C type declarations are pretty universally despised.

>By whom?

>This is news to me.  I have always thought that the C type declaration
>is a concise and platform-independent way of declaring a packed
>structure, and effectively hiding implementation details (offsets into it)
>from the programmer.

>What is wrong with them, that makes them despicable?

Hiding the padding means that two compilers might not be able
to get at the same thing.

If you've ever tried to properly declare signal(3), you'll 
see the main pain I was thinking about:

    void  (*signal (int, void (*) (int))) (int);

It's not normally so bad with most structures, but try declaring
an array of functions that return pointers to functions. :-(

--tom

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About