From: Robert Feldt Date: 2003-09-11T00:28:25+09:00 Subject: Re: Calling fun taking struct and not pointer to struct? Nathaniel Talbott skrev den Thu, 11 Sep 2003 00:06:18 +0900: > Hmmm... I may end up doing that for now, but it's just so ugly. It sure > would be nice to have direct support for this in the DL library like so: > > module M > extend DL::Importable > > S1 = struct [ > 'int a', > 'int b' > ] > > typealias('S1', S1) > > S2 = struct [ > 'S1 c', > 'S1 d' > ] > end > > s = M::S2::malloc > s.c.a = 42 > > Or something like that. I've looked at the internals of the DL library some, > and it seems pretty clean, so I may see if I can create a patch to do the > above. > I agree it seems pretty straightforward and useful. It still depends on the answer to the 3 question above. But I guess it's unlikely a C compiler would do it in any other way. This "cheat" at least works on gcc 3.2 20020908 on cygwin and 3.2.3 20030422 on Gentoo linux. Regards, Robert