Taylan Ulrich Bayirli/Kammer <[email protected]>:

> 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