guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A couple of questions about goops method parameters


From: Marko Rauhamaa
Subject: Re: A couple of questions about goops method parameters
Date: Sat, 06 Sep 2014 01:26:27 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

Taylan Ulrich Bayirli/Kammer <address@hidden>:

> Though after pondering a bit I realized that it indeed seems impossible
> to compile "(.bar foo)" (could result from "foo[.bar]" via SRFI-105)
> into the correct memory offset, if there are multiple record types each
> with a '.bar' field, because it's not statically known which record type
> 'foo' has.  Maybe that's exactly what you meant.

Yes.

It is amusing, though, that C originally suffered from the same issue:
the struct field offsets were global linker objects. That's why to this
day, unix/linux C structs have ugly field prefixes:

    struct timeval {
        time_t      tv_sec;
        suseconds_t tv_usec;
    };

    struct timezone {
        int tz_minuteswest;
        int tz_dsttime;
    };

    struct linger {
        int l_onoff;
        int l_linger;
    };

    struct sockaddr_in {
        sa_family_t    sin_family;
        in_port_t      sin_port;
        struct in_addr sin_addr;
    };

    struct in_addr {
        uint32_t       s_addr;
    };

    struct iovec {
        void  *iov_base;
        size_t iov_len;
    };

and so on...


Marko



reply via email to

[Prev in Thread] Current Thread [Next in Thread]