Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!sun-barr!sun!arabian!jamesa From: jamesa@arabian.Sun.COM (James D. Allen) Newsgroups: comp.lang.c Subject: Re: Another silly question Message-ID: <105998@sun.Eng.Sun.COM> Date: 21 May 89 21:45:39 GMT References: <17812@cup.portal.com> <607@kl-cs.UUCP> <749@mccc.UUCP> <10299@smoke.BRL.MIL> Sender: news@sun.Eng.Sun.COM Lines: 24 In article <10299@smoke.BRL.MIL>, gwyn@smoke.BRL.MIL (Doug Gwyn) writes: >In article <13234@haddock.ima.isc.com> karl@haddock.ima.isc.com (Karl Heuer) writes: >>... outlawing "i[a]" would have been a small step >>towards making arrays higher-class citizens than they are. > >I don't think you can ever make the existing C arrays first-class >objects without invalidating large amounts of existing correct code. >There are efforts underway to find a suitable language extension >that solves this problem (for the new class of objects provided by >the extension). One source of trouble is "hidden" array typedefs, such as `jmp_buf'. (You have to "know" what a jmp_buf is to use it nontrivially, while if it were "first-class" you wouldn't.) But a logical array can be promoted to a first-class citizen by just putting it in a structure: typedef struct { jmp_buf j; } first_class_jmpbuf; Any idea why this wasn't done for jmp_buf's? I think the "second-classedness" of arrays helps give C its elegant syntax. Any other examples of the "problems" it causes?