From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c63aa81a67eceb8f X-Google-Attributes: gid103376,public From: Ted Dennison Subject: Re: Ragged Array Proposal Date: 1999/09/22 Message-ID: <7satei$e2q$1@nnrp1.deja.com>#1/1 X-Deja-AN: 528094047 References: <37e7c08e@eeyore.callnetuk.com> X-Http-Proxy: 1.0 x25.deja.com:80 (Squid/1.1.22) for client 204.48.27.130 Organization: Deja.com - Share what you know. Learn what you don't. X-Article-Creation-Date: Wed Sep 22 15:43:18 1999 GMT X-MyDeja-Info: XMYDJUIDtedennison Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.6 [en] (WinNT; I) Date: 1999-09-22T00:00:00+00:00 List-Id: In article <37e7c08e@eeyore.callnetuk.com>, "Nick Roberts" wrote: > I have set up a WWW site, and posted an article on it detailing a first > draft of my proposal for a 'ragged array type' extension to the language. > The URL is: > > http://www.callnetuk.com/home/nickroberts > > Do please take a look. > > I seem to get the impression that the cognoscenti consider this > particular idea worthless. I am perfectly serious about it, however; I would have used the word "excessive" rather than "worthless". But then again, I probably wouldn't count as a cognoscentum. One thing confuses me about your proposal. You say that when the array is declared all the elements will be constrained. But then you say that you can dynamicly change elements. Are you saying that if I try to assign a 5 character string into an array element that is a 4 character string, the compiler would accept it? If so, how about if a function returns a 5 character string? Or how about if the 4 character string element in the ragged array is passed into a subprogram as an "out" or "in out" parameter? Also for your example you say "the various ways of doing the equivalent thing in Ada 95 are all unappealing." I but I can do the equivalent thing in Ada 95 in only 2 more lines of code: type Command_String_Ptr is access all String; for Command_String_Ptr'Storage_Size use 1024; type Command is (Cut, Copy, Paste, ...); Labels: constant array (Command) of Command_String_Ptr := (Cut => new String'("Cu&t"), Copy => new String'("&Copy"), Paste => new String'("&Paste"), ...); Admittedly I have to keep watch that I leave enough space in the pool for all the command strings. But if this is in an outer block on a virtual memory OS (by far the typcial case), I don't even need the "for" clause. Anyway, perhaps you should explain in the proposal why this approach is unappealing vs. complicating the language. On the plus side, I find the proposal's visual layout, as well as that of the rest of your website, quite visually appealing. I hope it won't be too much of a challange to maintain that standard as your website grows. -- T.E.D. Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.