Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!midway!gargoyle!ddsw1!olsa99!ctk1!heidi From: heidi@ctk1.UUCP (Heidi de Wet) Newsgroups: comp.lang.c Subject: Re: Request for Comments: Aggregate Assignment in C ... Message-ID: <1990Dec14.130916.18447@ctk1.UUCP> Date: 14 Dec 90 13:09:16 GMT References: <77546@iuvax.cs.indiana.edu> <4479@goanna.cs.rmit.oz.au> Organization: Tran Systems Lines: 34 In <4479@goanna.cs.rmit.oz.au> ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) writes: >In article <77546@iuvax.cs.indiana.edu>, mayer@iuvax.cs.indiana.edu (Mayer Goldberg) writes: >> [Proposed alternative to 'with' construct] >> We submit that a better way of doing this would be to allow a >> kind of assignment that we allow during initialization. >> Something like: >> my_vec = {4,, 7}; As a staunch fan of Pascal, writing C for a living :-), this seems a very uninteresting problem. Pascal's 'with' doesn't solve this, anyway. It _does_ reduce the text associated with multiple references to the same record structure in one expression. Try this for size: (*Buff)->Msg_Bytes [(*Buff)->Start_Index + (*Buff)->Byte_Count] = B; Now try copying one 'Buff' to another... Any suggestions about this? If you want to make assignments of multiple elements in a structure easier, how about the construct 'A = B', where A and B are identical, complex structs or arrays? Yes, you can use memcpy, but it would be nice to see the compiler doing a _little_ bit of work for a change. >If you want Ada, you know where to find it. >It you want to make it easy for people to introduce subtle and >difficult-to-locate mistakes in their programs, keep it up. Well, that would be entirely in the spirit of C, wouldn't it? -------------------- Heidi de Wet University of Cape Town, South Africa ddsw1!proxima!ctk1!heidi -or- proxima!ctk1!heidi@ddsw1.mcs.com